From 9f704b20ae580fd67c7d79fbc9692dd0fe1a933e Mon Sep 17 00:00:00 2001 From: dogeystamp Date: Sat, 12 Oct 2024 14:21:16 -0400 Subject: [PATCH] nvim: switch autoclose plugin --- .gitmodules | 51 ++----------------- src/dot_config/nvim/init.vim | 13 +++-- src/dot_config/nvim/lua/coding.lua | 11 ++++ .../site/pack/3pp/opt/external_auto-pairs | 1 - .../site/pack/3pp/opt/external_autoclose.nvim | 1 + 5 files changed, 24 insertions(+), 53 deletions(-) delete mode 160000 src/dot_local/share/nvim/site/pack/3pp/opt/external_auto-pairs create mode 160000 src/dot_local/share/nvim/site/pack/3pp/opt/external_autoclose.nvim diff --git a/.gitmodules b/.gitmodules index f6e84ab..5217a44 100644 --- a/.gitmodules +++ b/.gitmodules @@ -15,9 +15,9 @@ ################ # auto close brackets and quotes -[submodule "src/dot_local/share/nvim/site/pack/3pp/start/external_auto-pairs"] - path = src/dot_local/share/nvim/site/pack/3pp/opt/external_auto-pairs - url = https://github.com/jiangmiao/auto-pairs +[submodule "src/dot_local/share/nvim/site/pack/3pp/opt/external_autoclose_nvim"] + path = src/dot_local/share/nvim/site/pack/3pp/opt/external_autoclose.nvim + url = https://github.com/m4xshen/autoclose.nvim # language smarts # coding.lua @@ -67,48 +67,3 @@ [submodule "src/dot_local/share/nvim/site/pack/3pp/start/external_cmp_luasnip"] path = src/dot_local/share/nvim/site/pack/3pp/opt/external_cmp_luasnip url = https://github.com/saadparwaiz1/cmp_luasnip - - - -[submodule "submodule.src/dot_local/bin/external_pyinstantref.path"] - path = src/dot_local/bin/external_pyinstantref - url = https://github.com/dogeystamp/pyinstantref -[submodule "submodule.src/dot_local/bin/external_inkscape-shortcut-manager.path"] - path = src/dot_local/bin/external_inkscape-shortcut-manager - url = https://github.com/dogeystamp/inkscape-shortcut-manager -[submodule "submodule.src/dot_local/share/nvim/site/pack/3pp/start/external_auto-pairs.path"] - path = src/dot_local/share/nvim/site/pack/3pp/opt/external_auto-pairs - url = https://github.com/jiangmiao/auto-pairs -[submodule "submodule.src/dot_local/share/nvim/site/pack/3pp/start/external_nvim-cmp.path"] - path = src/dot_local/share/nvim/site/pack/3pp/opt/external_nvim-cmp - url = https://github.com/hrsh7th/nvim-cmp.git -[submodule "submodule.src/dot_local/share/nvim/site/pack/3pp/start/external_cmp-nvim-lsp.path"] - path = src/dot_local/share/nvim/site/pack/3pp/opt/external_cmp-nvim-lsp - url = https://github.com/hrsh7th/cmp-nvim-lsp.git -[submodule "submodule.src/dot_local/share/nvim/site/pack/3pp/start/external_nvim-treesitter.path"] - path = src/dot_local/share/nvim/site/pack/3pp/opt/external_nvim-treesitter - url = https://github.com/nvim-treesitter/nvim-treesitter.git -[submodule "submodule.src/dot_local/share/nvim/site/pack/3pp/start/external_vim-ledger.path"] - path = src/dot_local/share/nvim/site/pack/3pp/start/external_vim-ledger - url = https://github.com/ledger/vim-ledger.git -[submodule "submodule.src/dot_local/share/nvim/site/pack/3pp/start/external_nvim-noirbuddy.path"] - path = src/dot_local/share/nvim/site/pack/3pp/opt/external_nvim-noirbuddy - url = https://github.com/jesseleite/nvim-noirbuddy.git -[submodule "submodule.src/dot_local/share/nvim/site/pack/3pp/start/external_colorbuddy.nvim.path"] - path = src/dot_local/share/nvim/site/pack/3pp/opt/external_colorbuddy.nvim - url = https://github.com/tjdevries/colorbuddy.nvim.git -[submodule "submodule.src/dot_local/share/nvim/site/pack/3pp/start/external_nvim-dap.path"] - path = src/dot_local/share/nvim/site/pack/3pp/opt/external_nvim-dap - url = https://github.com/mfussenegger/nvim-dap.git -[submodule "submodule.src/dot_local/share/nvim/site/pack/3pp/start/external_nvim-dap-ui.path"] - path = src/dot_local/share/nvim/site/pack/3pp/opt/external_nvim-dap-ui - url = https://github.com/rcarriga/nvim-dap-ui.git -[submodule "submodule.src/dot_local/share/nvim/site/pack/3pp/start/external_nvim-nio.path"] - path = src/dot_local/share/nvim/site/pack/3pp/opt/external_nvim-nio - url = https://github.com/nvim-neotest/nvim-nio -[submodule "submodule.src/dot_local/share/nvim/site/pack/3pp/start/external_LuaSnip.path"] - path = src/dot_local/share/nvim/site/pack/3pp/opt/external_LuaSnip - url = https://github.com/L3MON4D3/LuaSnip -[submodule "submodule.src/dot_local/share/nvim/site/pack/3pp/start/external_cmp_luasnip.path"] - path = src/dot_local/share/nvim/site/pack/3pp/opt/external_cmp_luasnip - url = https://github.com/saadparwaiz1/cmp_luasnip diff --git a/src/dot_config/nvim/init.vim b/src/dot_config/nvim/init.vim index 30f72af..6dd76dc 100644 --- a/src/dot_config/nvim/init.vim +++ b/src/dot_config/nvim/init.vim @@ -63,6 +63,7 @@ let maplocalleader = " " " easier binds to use system clipboard with nmap y "+y nmap Y "+Y +nmap D "+D vmap y "+y nmap d "+d vmap d "+d @@ -71,6 +72,14 @@ nmap C "+C vmap c "+c nmap p "+p +" faster indent binds +" conflicts with motions, e.g. >> +nnoremap < << +" don't deselect after a visual indent +vnoremap < >gv + " 0 is easier to reach so swap these binds nnoremap 0 ^ nnoremap ^ 0 @@ -103,10 +112,6 @@ nnoremap ZF :qa " see .config/nvim/lua/init.lua lua require('init') -" auto-pairs -packadd auto-pairs -let g:AutoPairsFlyMode = 0 - " disable warnings in health check let g:loaded_node_provider = 0 let g:loaded_perl_provider = 0 diff --git a/src/dot_config/nvim/lua/coding.lua b/src/dot_config/nvim/lua/coding.lua index 6ec50b7..ebf6e17 100644 --- a/src/dot_config/nvim/lua/coding.lua +++ b/src/dot_config/nvim/lua/coding.lua @@ -68,6 +68,17 @@ vim.wo.foldmethod = 'expr' vim.wo.foldexpr = 'v:lua.vim.treesitter.foldexpr()' vim.wo.foldlevel = 99 -- unfold by default +-------- +-- auto-pairs for brackets +-------- +vim.cmd.packadd("autoclose.nvim") +require("autoclose").setup({ + keys = { + ["$"] = { escape = true, close = true, pair = "$$", enabled_filetypes = {"typst"} }, + } +}) + + ------ -- diagnostics box ------ diff --git a/src/dot_local/share/nvim/site/pack/3pp/opt/external_auto-pairs b/src/dot_local/share/nvim/site/pack/3pp/opt/external_auto-pairs deleted file mode 160000 index 39f06b8..0000000 --- a/src/dot_local/share/nvim/site/pack/3pp/opt/external_auto-pairs +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 39f06b873a8449af8ff6a3eee716d3da14d63a76 diff --git a/src/dot_local/share/nvim/site/pack/3pp/opt/external_autoclose.nvim b/src/dot_local/share/nvim/site/pack/3pp/opt/external_autoclose.nvim new file mode 160000 index 0000000..b2077aa --- /dev/null +++ b/src/dot_local/share/nvim/site/pack/3pp/opt/external_autoclose.nvim @@ -0,0 +1 @@ +Subproject commit b2077aa2c83df7ebc19b2a20a3a0654b24ae9c8f