astro-nvim-v3 - modified folder structure

This commit is contained in:
huyjaky
2025-01-19 12:00:28 +07:00
parent fe00af8147
commit 3c4feebbcc
21 changed files with 363 additions and 443 deletions

View File

@@ -4,7 +4,7 @@
"LuaSnip": { "branch": "master", "commit": "03c8e67eb7293c404845b3982db895d59c0d1538" },
"aerial.nvim": { "branch": "master", "commit": "1160fb7a15a34b03b7381d95d45560712b5f19d0" },
"alpha-nvim": { "branch": "main", "commit": "de72250e054e5e691b9736ee30db72c65d560771" },
"astrocommunity": { "branch": "main", "commit": "532a545db91bbc63be038fee99cf2666cc3b6350" },
"astrocommunity": { "branch": "main", "commit": "bac0a03e1f661600efa1e4c848416355d2ce1586" },
"astrocore": { "branch": "main", "commit": "0fcaac66d115948605c14eaf45a41d3923eaafeb" },
"astrolsp": { "branch": "main", "commit": "2f6b0a4059775a1dac011d2944dd41fd4a8fe7a8" },
"astrotheme": { "branch": "main", "commit": "41b7d8430a55fd771e41bd763af4c3fd1c2fc0b5" },

View File

@@ -13,7 +13,7 @@ return {
large_buf = { size = 1024 * 500, lines = 10000 }, -- set global limits for large files for disabling features like treesitter
autopairs = false, -- enable autopairs at start
cmp = true, -- enable completion at start
diagnostics_mode = 3, -- diagnostic mode on start (0 = off, 1 = no signs/virtual text, 2 = no virtual text, 3 = on)
diagnostics_mode = 0, -- diagnostic mode on start (0 = off, 1 = no signs/virtual text, 2 = no virtual text, 3 = on)
highlighturl = false, -- highlight URLs at start
notifications = true, -- enable notifications at start
},

View File

@@ -122,7 +122,7 @@ return {
-- ["<C-f>"] = cmp.mapping(function(fallback)
-- -- Check if Copilot is suggesting something
-- if vim.fn["copilot#Accept"]() ~= "" then
-- vim.api.nvim_set_keymap("i", "<C-f>", "copilot#Accept('')", { expr = true, silent = true })
-- vim.api.nvim_set_keymap("i", "<C-f>", 'copilot#Accept("\\<CR>")', { expr = true, silent = true })
-- else
-- fallback() -- If no suggestion, fallback to default behavior
-- end

View File

@@ -1,30 +0,0 @@
return {
"CRAG666/code_runner.nvim",
opts = {
filetype = {
java = {
"cd $dir &&",
"javac $fileName &&",
"java $fileNameWithoutExt",
},
python = {
"cd $dir &&",
"python3 -u $fileName",
},
rust = {
"cd $dir &&",
"rustc $fileName &&",
"$dir/$fileNameWithoutExt",
},
},
},
keys = {
{ "<leader>r", ":RunCode<CR>", mode = "n", noremap = true, silent = false, desc = "Run code" },
{ "<leader>rf", ":RunFile<CR>", mode = "n", noremap = true, silent = false, desc = "Run file" },
{ "<leader>rft", ":RunFile tab<CR>", mode = "n", noremap = true, silent = false, desc = "Run file in new tab" },
{ "<leader>rp", ":RunProject<CR>", mode = "n", noremap = true, silent = false, desc = "Run project" },
{ "<leader>rc", ":RunClose<CR>", mode = "n", noremap = true, silent = false, desc = "Close run" },
{ "<leader>crf", ":CRFiletype<CR>", mode = "n", noremap = true, silent = false, desc = "Change run filetype" },
{ "<leader>crp", ":CRProjects<CR>", mode = "n", noremap = true, silent = false, desc = "Change run projects" },
},
}

View File

@@ -12,12 +12,9 @@ return {
{ "kmontocam/nvim-conda", enabled = false },
{ "NMAC427/guess-indent.nvim", enabled = false },
{ "lukas-reineke/indent-blankline.nvim", enabled = false },
{ "chipsenkbeil/distant.nvim", enabled = false },
{ "gen740/SmoothCursor.nvim", enabled = false },
{ "AstroNvim/astrotheme", enabled = false },
{ "scottmckendry/cyberdream.nvim", enabled = false },
{ "xiyaowong/transparent.nvim", enabled = false },
{ "MagicDuck/grug-far.nvim", enabled = false },
{ "loctvl842/monokai-pro.nvim", enabled = false },
{ "xiyaowong/transparent.nvim", enabled = false },
{ "iamcco/markdown-preview.nvim", enabled = false },

View File

@@ -1,21 +0,0 @@
-- NOTE: control remote pc
return {
"chipsenkbeil/distant.nvim",
branch = "v0.3",
event = "VimEnter",
cmd = {
"DistantLaunch",
"DistantOpen",
"DistantConnect",
"DistantInstall",
"DistantMetadata",
"DistantShell",
"DistantShell",
"DistantSystemInfo",
"DistantClientVersion",
"DistantSessionInfo",
"DistantCopy",
},
config = function() require("distant"):setup() end,
}

View File

@@ -1,4 +1,3 @@
local rainbow = require "plugins.ts-rainbow"
-- Plugins that enhance editor experience
return {
{

View File

@@ -1,43 +0,0 @@
-- Plugins to add additional functionality for LSP
return {
-- Signature help
{
"ray-x/lsp_signature.nvim",
event = "User AstroFile",
config = function()
require("lsp_signature").setup {
bind = true,
handler_opts = { border = "rounded" },
hint_enable = true,
hint_prefix = "🐼 ",
debug = true,
verbose = true,
}
end,
},
-- Additional features for Clangd
-- {
-- "p00f/clangd_extensions.nvim",
-- lazy = true,
-- ft = { "c", "cpp" },
-- dependencies = {
-- "AstroNvim/astrocore",
-- opts = {
-- autocmds = {
-- clangd_extensions = {
-- {
-- event = "LspAttach",
-- desc = "Load clangd_extensions with clangd",
-- callback = function(args)
-- if assert(vim.lsp.get_client_by_id(args.data.client_id)).name == "clangd" then
-- require "clangd_extensions"
-- vim.api.nvim_del_augroup_by_name "clangd_extensions"
-- end
-- end,
-- },
-- },
-- },
-- },
-- },
-- },
}

View File

@@ -1,47 +0,0 @@
return {
"echasnovski/mini.icons",
opts = function(_, opts)
if vim.g.icons_enabled ~= false then
opts.style = "glyph" -- Use glyph icons when available
else
opts.style = "ascii" -- Fallback to ASCII if glyphs are disabled
end
end,
lazy = true,
specs = {
{ "nvim-tree/nvim-web-devicons", enabled = false, optional = true },
{
"nvim-neo-tree/neo-tree.nvim",
opts = {
default_component_configs = {
icon = {
provider = function(icon, node)
local text, hl
local mini_icons = require "mini.icons"
if node.type == "file" then
text, hl = mini_icons.get("file", node.name)
elseif node.type == "directory" then
text, hl = mini_icons.get("directory", node.name)
if node:is_expanded() then text = nil end
end
if text then icon.text = text end
if hl then icon.highlight = hl end
end,
},
kind_icon = {
provider = function(icon, node)
icon.text, icon.highlight = require("mini.icons").get("lsp", node.extra.kind.name)
end,
},
},
},
},
},
init = function()
package.preload["nvim-web-devicons"] = function()
require("mini.icons").mock_nvim_web_devicons()
return package.loaded["nvim-web-devicons"]
end
end,
}

View File

@@ -1,40 +0,0 @@
return {
"echasnovski/mini.move",
keys = function(_, keys)
local plugin = require("lazy.core.config").spec.plugins["mini.move"]
local opts = require("lazy.core.plugin").values(plugin, "opts", false) -- resolve mini.clue options
-- Populate the keys based on the user's options
local mappings = {
{ opts.mappings.line_left, desc = "Move line left" },
{ opts.mappings.line_right, desc = "Move line right" },
{ opts.mappings.line_down, desc = "Move line down" },
{ opts.mappings.line_up, desc = "Move line up" },
{ opts.mappings.left, desc = "Move selection left", mode = "v" },
{ opts.mappings.right, desc = "Move selection right", mode = "v" },
{ opts.mappings.down, desc = "Move selection down", mode = "v" },
{ opts.mappings.up, desc = "Move selection up", mode = "v" },
}
mappings = vim.tbl_filter(function(m) return m[1] and #m[1] > 0 end, mappings)
return vim.list_extend(mappings, keys)
end,
opts = {
mappings = {
left = "<A-a>",
right = "<A-d>",
down = "<A-s>",
up = "<A-w>",
line_left = "<A-a>",
line_right = "<A-d>",
line_down = "<A-s>",
line_up = "<A-w>",
},
},
specs = {
{
"bamboo", -- Replace with the correct name for the Bamboo colorscheme package if necessary
optional = true,
---@type BambooOptions -- Adjust type if Bamboo has specific options
opts = { integrations = { mini = true } },
},
},
}

96
lua/plugins/mini.lua Normal file
View File

@@ -0,0 +1,96 @@
return {
{
"echasnovski/mini.icons",
opts = function(_, opts)
if vim.g.icons_enabled ~= false then
opts.style = "glyph" -- Use glyph icons when available
else
opts.style = "ascii" -- Fallback to ASCII if glyphs are disabled
end
end,
lazy = true,
specs = {
{ "nvim-tree/nvim-web-devicons", enabled = false, optional = true },
{
"nvim-neo-tree/neo-tree.nvim",
opts = {
default_component_configs = {
icon = {
provider = function(icon, node)
local text, hl
local mini_icons = require "mini.icons"
if node.type == "file" then
text, hl = mini_icons.get("file", node.name)
elseif node.type == "directory" then
text, hl = mini_icons.get("directory", node.name)
if node:is_expanded() then text = nil end
end
if text then icon.text = text end
if hl then icon.highlight = hl end
end,
},
kind_icon = {
provider = function(icon, node)
icon.text, icon.highlight = require("mini.icons").get("lsp", node.extra.kind.name)
end,
},
},
},
},
},
init = function()
package.preload["nvim-web-devicons"] = function()
require("mini.icons").mock_nvim_web_devicons()
return package.loaded["nvim-web-devicons"]
end
end,
},
{
"echasnovski/mini.icons",
opts = function(_, opts)
if vim.g.icons_enabled ~= false then
opts.style = "glyph" -- Use glyph icons when available
else
opts.style = "ascii" -- Fallback to ASCII if glyphs are disabled
end
end,
lazy = true,
specs = {
{ "nvim-tree/nvim-web-devicons", enabled = false, optional = true },
{
"nvim-neo-tree/neo-tree.nvim",
opts = {
default_component_configs = {
icon = {
provider = function(icon, node)
local text, hl
local mini_icons = require "mini.icons"
if node.type == "file" then
text, hl = mini_icons.get("file", node.name)
elseif node.type == "directory" then
text, hl = mini_icons.get("directory", node.name)
if node:is_expanded() then text = nil end
end
if text then icon.text = text end
if hl then icon.highlight = hl end
end,
},
kind_icon = {
provider = function(icon, node)
icon.text, icon.highlight = require("mini.icons").get("lsp", node.extra.kind.name)
end,
},
},
},
},
},
init = function()
package.preload["nvim-web-devicons"] = function()
require("mini.icons").mock_nvim_web_devicons()
return package.loaded["nvim-web-devicons"]
end
end,
},
}

View File

@@ -1,40 +0,0 @@
return {
"brenton-leighton/multiple-cursors.nvim",
event = "BufRead",
cmd = {
"MultipleCursorsAddDown",
"MultipleCursorsAddUp",
"MultipleCursorsMouseAddDelete",
"MultipleCursorsAddMatches",
"MultipleCursorsAddMatchesV",
"MultipleCursorsAddJumpNextMatch",
"MultipleCursorsJumpNextMatch",
"MultipleCursorsLock",
},
dependencies = {
"AstroNvim/astrocore",
opts = function(_, opts)
local maps = opts.mappings
for lhs, map in pairs {
["<C-Down>"] = { "<Cmd>MultipleCursorsAddDown<CR>", desc = "Add cursor down" },
["<C-Up>"] = { "<Cmd>MultipleCursorsAddUp<CR>", desc = "Add cursor up" },
["<C-LeftMouse>"] = { "<Cmd>MultipleCursorsMouseAddDelete<CR>", desc = "Add cursor with mouse" },
} do
maps.n[lhs] = map
maps.i[lhs] = map
end
local prefix = "<Leader>c"
for lhs, map in pairs {
[prefix .. "a"] = { "<Cmd>MultipleCursorsAddMatches<CR>", desc = "Add cursor matches" },
[prefix .. "A"] = { "<Cmd>MultipleCursorsAddMatchesV<CR>", desc = "Add cursor matches in previous visual area" },
[prefix .. "j"] = { "<Cmd>MultipleCursorsAddJumpNextMatch<CR>", desc = "Add cursor and jump to next match" },
[prefix .. "J"] = { "<Cmd>MultipleCursorsJumpNextMatch<CR>", desc = "Move cursor to next match" },
[prefix .. "l"] = { "<Cmd>MultipleCursorsLock<CR>", desc = "Lock virtual cursors" },
} do
maps.n[lhs] = map
maps.x[lhs] = map
end
end,
},
opts = {},
}

View File

@@ -1,4 +0,0 @@
return {
"mg979/vim-visual-multi",
event = "BufRead",
}

49
lua/plugins/multiple.lua Normal file
View File

@@ -0,0 +1,49 @@
return {
{
"brenton-leighton/multiple-cursors.nvim",
event = "BufRead",
cmd = {
"MultipleCursorsAddDown",
"MultipleCursorsAddUp",
"MultipleCursorsMouseAddDelete",
"MultipleCursorsAddMatches",
"MultipleCursorsAddMatchesV",
"MultipleCursorsAddJumpNextMatch",
"MultipleCursorsJumpNextMatch",
"MultipleCursorsLock",
},
dependencies = {
"AstroNvim/astrocore",
opts = function(_, opts)
local maps = opts.mappings
for lhs, map in pairs {
["<C-Down>"] = { "<Cmd>MultipleCursorsAddDown<CR>", desc = "Add cursor down" },
["<C-Up>"] = { "<Cmd>MultipleCursorsAddUp<CR>", desc = "Add cursor up" },
["<C-LeftMouse>"] = { "<Cmd>MultipleCursorsMouseAddDelete<CR>", desc = "Add cursor with mouse" },
} do
maps.n[lhs] = map
maps.i[lhs] = map
end
local prefix = "<Leader>c"
for lhs, map in pairs {
[prefix .. "a"] = { "<Cmd>MultipleCursorsAddMatches<CR>", desc = "Add cursor matches" },
[prefix .. "A"] = {
"<Cmd>MultipleCursorsAddMatchesV<CR>",
desc = "Add cursor matches in previous visual area",
},
[prefix .. "j"] = { "<Cmd>MultipleCursorsAddJumpNextMatch<CR>", desc = "Add cursor and jump to next match" },
[prefix .. "J"] = { "<Cmd>MultipleCursorsJumpNextMatch<CR>", desc = "Move cursor to next match" },
[prefix .. "l"] = { "<Cmd>MultipleCursorsLock<CR>", desc = "Lock virtual cursors" },
} do
maps.n[lhs] = map
maps.x[lhs] = map
end
end,
},
opts = {},
},
{
"mg979/vim-visual-multi",
event = "BufRead",
},
}

View File

@@ -1,68 +1,105 @@
return {
"rcarriga/nvim-dap-ui",
requires = { "mfussenegger/nvim-dap", "nvim-neotest/nvim-nio" },
opts = {
eval = true,
mappings = {
edit = "e",
expand = { "<CR>", "<2-LeftMouse>" },
open = "o",
remove = "d",
repl = "r",
toggle = "t",
},
{
{
"rcarriga/nvim-dap-ui",
requires = { "mfussenegger/nvim-dap", "nvim-neotest/nvim-nio" },
opts = {
eval = true,
mappings = {
edit = "e",
expand = { "<CR>", "<2-LeftMouse>" },
open = "o",
remove = "d",
repl = "r",
toggle = "t",
},
layouts = {
{
elements = {
layouts = {
{
id = "repl",
size = 0.5,
elements = {
{
id = "repl",
size = 0.5,
},
{
id = "console",
size = 0.5,
},
},
position = "left",
size = 40,
},
{
id = "console",
size = 0.5,
elements = {
{
id = "scopes",
size = 0.25,
},
{
id = "breakpoints",
size = 0.25,
},
-- {
-- id = "stacks",
-- size = 0.25,
-- },
},
position = "bottom",
size = 8,
},
},
position = "left",
size = 40,
},
{
elements = {
{
id = "scopes",
size = 0.25,
},
{
id = "breakpoints",
size = 0.25,
},
-- {
-- id = "stacks",
-- size = 0.25,
-- },
},
position = "bottom",
size = 8,
config = function(_, opts)
local dap = require "dap"
local dapui = require "dapui"
-- Initialize dap-ui
dapui.setup(opts)
-- Prevent UI from closing when debugging session ends
dap.listeners.after.event_terminated["dapui"] = function()
-- Do nothing, keeping the UI open
end
dap.listeners.after.event_exited["dapui"] = function()
-- Do nothing, keeping the UI open
end
-- Optionally, open dap-ui when session starts
dap.listeners.after.event_initialized["dapui"] = function() dapui.open() end
end,
},
{
"theHamsta/nvim-dap-virtual-text",
event = "User AstroFile",
opts = {
commented = false,
enabled = true,
enabled_commands = true,
show_stop_reason = true,
virt_text_pos = "eol",
},
},
},
config = function(_, opts)
local dap = require "dap"
local dapui = require "dapui"
-- Initialize dap-ui
dapui.setup(opts)
-- Prevent UI from closing when debugging session ends
dap.listeners.after.event_terminated["dapui"] = function()
-- Do nothing, keeping the UI open
end
dap.listeners.after.event_exited["dapui"] = function()
-- Do nothing, keeping the UI open
end
-- Optionally, open dap-ui when session starts
dap.listeners.after.event_initialized["dapui"] = function() dapui.open() end
end,
{
"chrisgrieser/nvim-lsp-endhints",
event = "LspAttach",
opts = {
icons = {
type = "󰜁 ",
parameter = "󰏪 ",
offspec = "", -- hint kind not defined in official LSP spec
unknown = "", -- hint kind is nil
},
label = {
truncateAtChars = 20,
padding = 1,
marginLeft = 0,
sameKindSeparator = ", ",
},
extmark = {
priority = 50,
},
autoEnableHints = true,
},
},
}

View File

@@ -1,11 +0,0 @@
return {
"theHamsta/nvim-dap-virtual-text",
event = "User AstroFile",
opts = {
commented = false,
enabled = true,
enabled_commands = true,
show_stop_reason = true,
virt_text_pos = 'eol'
},
}

View File

@@ -1,22 +0,0 @@
return {
"chrisgrieser/nvim-lsp-endhints",
event = "LspAttach",
opts = {
icons = {
type = "󰜁 ",
parameter = "󰏪 ",
offspec = "", -- hint kind not defined in official LSP spec
unknown = "", -- hint kind is nil
},
label = {
truncateAtChars = 20,
padding = 1,
marginLeft = 0,
sameKindSeparator = ", ",
},
extmark = {
priority = 50,
},
autoEnableHints = true,
},
}

View File

@@ -1,25 +0,0 @@
return {
"folke/todo-comments.nvim",
dependencies = { "nvim-lua/plenary.nvim" },
opts = {
-- your configuration comes here
-- or leave it empty to use the default settings
-- refer to the configuration section below
keywords = {
FIX = {
icon = "", -- icon used for the sign, and in search results
color = "error", -- can be a hex color, or a named color (see below)
alt = { "FIXME", "BUG", "FIXIT", "ISSUE" }, -- a set of other keywords that all map to this FIX keywords
-- signs = false, -- configure signs for some keywords individually
},
TODO = { icon = "", color = "info" },
GOAL = { icon = "", color = "info" },
HACK = { icon = "", color = "warning" },
WARN = { icon = "", color = "warning", alt = { "WARNING", "XXX" } },
PERF = { icon = "", alt = { "OPTIM", "PERFORMANCE", "OPTIMIZE" } },
NOTE = { icon = "", color = "hint", alt = { "INFO" } },
TEST = { icon = "", color = "test", alt = { "TESTING", "PASSED", "FAILED" } },
},
},
}

View File

@@ -1,33 +0,0 @@
return {
{
"HiPhish/rainbow-delimiters.nvim",
dependencies = {
"nvim-treesitter/nvim-treesitter",
{
"AstroNvim/astrocore",
opts = {
mappings = {
n = {
["<Leader>u("] = {
function()
local bufnr = vim.api.nvim_get_current_buf()
require("rainbow-delimiters").toggle(bufnr)
require("astrocore").notify(
string.format(
"Buffer rainbow delimeters %s",
require("rainbow-delimiters").is_enabled(bufnr) and "on" or "off"
)
)
end,
desc = "Toggle rainbow delimeters (buffer)",
},
},
},
},
},
},
event = "User AstroFile",
main = "rainbow-delimiters.setup",
opts = {},
},
}

View File

@@ -38,4 +38,126 @@ return {
{ "<Leader>uT", "<Cmd>TransparentToggle<CR>", desc = "Toggle transparent" },
},
},
{
{
"HiPhish/rainbow-delimiters.nvim",
dependencies = {
"nvim-treesitter/nvim-treesitter",
{
"AstroNvim/astrocore",
opts = {
mappings = {
n = {
["<Leader>u("] = {
function()
local bufnr = vim.api.nvim_get_current_buf()
require("rainbow-delimiters").toggle(bufnr)
require("astrocore").notify(
string.format(
"Buffer rainbow delimeters %s",
require("rainbow-delimiters").is_enabled(bufnr) and "on" or "off"
)
)
end,
desc = "Toggle rainbow delimeters (buffer)",
},
},
},
},
},
},
event = "User AstroFile",
main = "rainbow-delimiters.setup",
opts = {},
},
},
{
"folke/todo-comments.nvim",
dependencies = { "nvim-lua/plenary.nvim" },
opts = {
-- your configuration comes here
-- or leave it empty to use the default settings
-- refer to the configuration section below
keywords = {
FIX = {
icon = "", -- icon used for the sign, and in search results
color = "error", -- can be a hex color, or a named color (see below)
alt = { "FIXME", "BUG", "FIXIT", "ISSUE" }, -- a set of other keywords that all map to this FIX keywords
-- signs = false, -- configure signs for some keywords individually
},
TODO = { icon = "", color = "info" },
GOAL = { icon = "", color = "info" },
HACK = { icon = "", color = "warning" },
WARN = { icon = "", color = "warning", alt = { "WARNING", "XXX" } },
PERF = { icon = "", alt = { "OPTIM", "PERFORMANCE", "OPTIMIZE" } },
NOTE = { icon = "", color = "hint", alt = { "INFO" } },
TEST = { icon = "", color = "test", alt = { "TESTING", "PASSED", "FAILED" } },
},
},
},
{
"altermo/ultimate-autopair.nvim",
event = "InsertEnter",
branch = "v0.6", --recommended as each new version will have breaking changes
opts = {
-- disable autopair in the command line: https://github.com/altermo/ultimate-autopair.nvim/issues/8
cmap = false,
extensions = {
cond = {
-- disable in comments
-- https://github.com/altermo/ultimate-autopair.nvim/blob/6fd0d6aa976a97dd6f1bed4d46be1b437613a52f/Q%26A.md?plain=1#L26
cond = {
function(fn) return not fn.in_node "comment" end,
},
},
-- get fly mode working on strings:
-- https://github.com/altermo/ultimate-autopair.nvim/issues/33
fly = {
nofilter = true,
},
},
config_internal_pairs = {
{ '"', '"', fly = true },
{ "'", "'", fly = true },
{ "[", "]", fly = true },
{ "{", "}", fly = true },
{ "(", ")", fly = true },
-- { "<", ">", fly = true },
},
},
dependencies = {
{
"AstroNvim/astrocore",
opts = {
mappings = {
n = {
["<Leader>ua"] = {
desc = "Toggle Ultimate Autopair",
function()
local notify = require("astrocore").notify
local function bool2str(bool) return bool and "on" or "off" end
local ok, ultimate_autopair = pcall(require, "ultimate-autopair")
if ok then
ultimate_autopair.toggle()
vim.g.ultimate_autopair_enabled = require("ultimate-autopair.core").disable
notify(string.format("ultimate-autopair %s", bool2str(not vim.g.ultimate_autopair_enabled)))
else
notify "ultimate-autopair not available"
end
end,
},
},
},
},
},
},
specs = {
{
"windwp/nvim-autopairs",
optional = true,
enabled = false,
},
},
},
}

View File

@@ -1,64 +0,0 @@
return {
"altermo/ultimate-autopair.nvim",
event = "InsertEnter",
branch = "v0.6", --recommended as each new version will have breaking changes
opts = {
-- disable autopair in the command line: https://github.com/altermo/ultimate-autopair.nvim/issues/8
cmap = false,
extensions = {
cond = {
-- disable in comments
-- https://github.com/altermo/ultimate-autopair.nvim/blob/6fd0d6aa976a97dd6f1bed4d46be1b437613a52f/Q%26A.md?plain=1#L26
cond = {
function(fn) return not fn.in_node "comment" end,
},
},
-- get fly mode working on strings:
-- https://github.com/altermo/ultimate-autopair.nvim/issues/33
fly = {
nofilter = true,
},
},
config_internal_pairs = {
{ '"', '"', fly = true },
{ "'", "'", fly = true },
{ "[", "]", fly = true },
{ "{", "}", fly = true },
{ "(", ")", fly = true },
-- { "<", ">", fly = true },
},
},
dependencies = {
{
"AstroNvim/astrocore",
opts = {
mappings = {
n = {
["<Leader>ua"] = {
desc = "Toggle Ultimate Autopair",
function()
local notify = require("astrocore").notify
local function bool2str(bool) return bool and "on" or "off" end
local ok, ultimate_autopair = pcall(require, "ultimate-autopair")
if ok then
ultimate_autopair.toggle()
vim.g.ultimate_autopair_enabled = require("ultimate-autopair.core").disable
notify(string.format("ultimate-autopair %s", bool2str(not vim.g.ultimate_autopair_enabled)))
else
notify "ultimate-autopair not available"
end
end,
},
},
},
},
},
},
specs = {
{
"windwp/nvim-autopairs",
optional = true,
enabled = false,
},
},
}