aboutsummaryrefslogtreecommitdiffstats
path: root/init.lua
diff options
context:
space:
mode:
authorphilw <dscr@duck.com>2025-01-15 16:12:18 +0100
committerphilw <dscr@duck.com>2025-01-15 16:12:18 +0100
commit27f1cf535c25e91667acf2c13db6c871ed28e0b0 (patch)
tree5317a847ea082c707917d74962600b7c19927140 /init.lua
parent41ffe7df220a5a9aa5404f33e39e893cdad902c8 (diff)
downloadneovim-27f1cf535c25e91667acf2c13db6c871ed28e0b0.tar.gz
neovim-27f1cf535c25e91667acf2c13db6c871ed28e0b0.zip
Rewrite autopairs feature
Diffstat (limited to 'init.lua')
-rw-r--r--init.lua25
1 files changed, 22 insertions, 3 deletions
diff --git a/init.lua b/init.lua
index bf8f2f2..b1e8359 100644
--- a/init.lua
+++ b/init.lua
@@ -99,6 +99,28 @@ function ToggleVExplorer()
99 end 99 end
100end 100end
101 101
102
103
104local function setup_autopairs()
105 local autopairs = {
106 ["("] = ")",
107 ["["] = "]",
108 ["{"] = "}",
109 ["<"] = ">",
110 }
111
112 for open, close in pairs(autopairs) do
113 vim.api.nvim_set_keymap(
114 'i',
115 open,
116 open .. close .. "<Left>",
117 { noremap = true, silent = true }
118 )
119 end
120end
121
122setup_autopairs()
123
102local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" 124local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
103if not vim.loop.fs_stat(lazypath) then 125if not vim.loop.fs_stat(lazypath) then
104 vim.fn.system( 126 vim.fn.system(
@@ -119,14 +141,12 @@ require("lazy").setup(
119 {"airblade/vim-gitgutter"}, 141 {"airblade/vim-gitgutter"},
120 {"norcalli/nvim-colorizer.lua"}, 142 {"norcalli/nvim-colorizer.lua"},
121 {"nvim-treesitter/nvim-treesitter"}, 143 {"nvim-treesitter/nvim-treesitter"},
122 {'echasnovski/mini.nvim', version = false},
123 { 144 {
124 "neovim/nvim-lspconfig", 145 "neovim/nvim-lspconfig",
125 lazy = false, 146 lazy = false,
126 dependencies = { 147 dependencies = {
127 {"ms-jpq/coq_nvim", branch = "coq"}, 148 {"ms-jpq/coq_nvim", branch = "coq"},
128 {"ms-jpq/coq.artifacts", branch = "artifacts"}, 149 {"ms-jpq/coq.artifacts", branch = "artifacts"},
129 -- {"ms-jpq/coq.thirdparty", branch = "3p"},
130 {"williamboman/mason.nvim"}, 150 {"williamboman/mason.nvim"},
131 {"williamboman/mason-lspconfig.nvim"} 151 {"williamboman/mason-lspconfig.nvim"}
132 }, 152 },
@@ -148,7 +168,6 @@ require("lazy").setup(
148 } 168 }
149) 169)
150require("colorizer").setup() 170require("colorizer").setup()
151require('mini.pairs').setup()
152 171
153vim.api.nvim_create_autocmd( 172vim.api.nvim_create_autocmd(
154 "BufWritePre", 173 "BufWritePre",