Mercurial > dotfiles
comparison dot_config/nvim/config.lua @ 370:5ffb0fd7b98d
Move treesitter config into packer_compiled
author | zegervdv <zegervdv@me.com> |
---|---|
date | Tue, 30 Mar 2021 21:47:55 +0200 |
parents | 72e8dd5a4ab5 |
children | 1dfda47d5d9e |
comparison
equal
deleted
inserted
replaced
369:eba1dee43703 | 370:5ffb0fd7b98d |
---|---|
143 vim.cmd [[ inoremap <silent><expr> <CR> compe#confirm({ 'keys': "\<Plug>delimitMateCR", 'mode': '' }) ]] | 143 vim.cmd [[ inoremap <silent><expr> <CR> compe#confirm({ 'keys': "\<Plug>delimitMateCR", 'mode': '' }) ]] |
144 vim.cmd [[ inoremap <silent><expr> <C-e> compe#close('<C-e>') ]] | 144 vim.cmd [[ inoremap <silent><expr> <C-e> compe#close('<C-e>') ]] |
145 end | 145 end |
146 } | 146 } |
147 use { | 147 use { |
148 'nvim-treesitter/nvim-treesitter', | 148 { |
149 'nvim-treesitter/nvim-treesitter', | |
150 config = function () | |
151 require "nvim-treesitter.highlight" | |
152 | |
153 require'nvim-treesitter.configs'.setup { | |
154 highlight = { | |
155 enable = false, | |
156 }, | |
157 incremental_selection = { | |
158 enable = true, | |
159 keymaps = { | |
160 init_selection = "gnn", | |
161 node_incremental = "grn", | |
162 scope_incremental = "grc", | |
163 node_decremental = "grm", | |
164 } | |
165 }, | |
166 refactor = { | |
167 highlight_definitions = { enable = true }, | |
168 smart_rename = { | |
169 enable = true, | |
170 keymaps = { | |
171 smart_rename = "gsr", | |
172 }, | |
173 }, | |
174 navigation = { | |
175 enable = true, | |
176 keymaps = { | |
177 goto_definition = "gnd", | |
178 list_definitions = "gnD", | |
179 }, | |
180 }, | |
181 }, | |
182 textobjects = { | |
183 move = { | |
184 enable = true, | |
185 goto_next_start = { | |
186 ["]]"] = "@block.outer", | |
187 }, | |
188 goto_previous_start = { | |
189 ["[["] = "@block.outer", | |
190 }, | |
191 goto_next_end = { | |
192 ["]["] = "@block.outer", | |
193 }, | |
194 goto_previous_end = { | |
195 ["[]"] = "@block.outer", | |
196 }, | |
197 }, | |
198 }, | |
199 playground = { | |
200 enable = true, | |
201 disable = {}, | |
202 updatetime = 25, | |
203 persist_queries = false | |
204 } | |
205 } | |
206 end | |
207 }, | |
149 'nvim-treesitter/nvim-treesitter-refactor', | 208 'nvim-treesitter/nvim-treesitter-refactor', |
150 'nvim-treesitter/nvim-treesitter-textobjects', | 209 'nvim-treesitter/nvim-treesitter-textobjects', |
151 {'nvim-treesitter/playground', opt = true} | 210 {'nvim-treesitter/playground', opt = true}, |
152 } | 211 } |
153 use {'SirVer/ultisnips'} | 212 use {'SirVer/ultisnips'} |
154 use { | 213 use { |
155 'glepnir/lspsaga.nvim', | 214 'glepnir/lspsaga.nvim', |
156 config = function() | 215 config = function() |
320 | 379 |
321 -- LSP and Treesitter config | 380 -- LSP and Treesitter config |
322 | 381 |
323 local lsp = require'lspconfig' | 382 local lsp = require'lspconfig' |
324 local lsputil = require'lspconfig.util' | 383 local lsputil = require'lspconfig.util' |
325 | |
326 require "nvim-treesitter.highlight" | |
327 | |
328 require'nvim-treesitter.configs'.setup { | |
329 highlight = { | |
330 enable = false, | |
331 }, | |
332 incremental_selection = { | |
333 enable = true, | |
334 keymaps = { | |
335 init_selection = "gnn", | |
336 node_incremental = "grn", | |
337 scope_incremental = "grc", | |
338 node_decremental = "grm", | |
339 } | |
340 }, | |
341 refactor = { | |
342 highlight_definitions = { enable = true }, | |
343 smart_rename = { | |
344 enable = true, | |
345 keymaps = { | |
346 smart_rename = "gsr", | |
347 }, | |
348 }, | |
349 navigation = { | |
350 enable = true, | |
351 keymaps = { | |
352 goto_definition = "gnd", | |
353 list_definitions = "gnD", | |
354 }, | |
355 }, | |
356 }, | |
357 textobjects = { | |
358 move = { | |
359 enable = true, | |
360 goto_next_start = { | |
361 ["]]"] = "@block.outer", | |
362 }, | |
363 goto_previous_start = { | |
364 ["[["] = "@block.outer", | |
365 }, | |
366 goto_next_end = { | |
367 ["]["] = "@block.outer", | |
368 }, | |
369 goto_previous_end = { | |
370 ["[]"] = "@block.outer", | |
371 }, | |
372 }, | |
373 }, | |
374 playground = { | |
375 enable = true, | |
376 disable = {}, | |
377 updatetime = 25, | |
378 persist_queries = false | |
379 } | |
380 } | |
381 | 384 |
382 local on_attach = function(client) | 385 local on_attach = function(client) |
383 mapper('n', '<CR>', '<cmd>lua require"lspsaga.diagnostic".show_line_diagnostics()<CR>') | 386 mapper('n', '<CR>', '<cmd>lua require"lspsaga.diagnostic".show_line_diagnostics()<CR>') |
384 mapper('n', 'gd', '<cmd>lua vim.lsp.buf.declaration()<CR>') | 387 mapper('n', 'gd', '<cmd>lua vim.lsp.buf.declaration()<CR>') |
385 mapper('n', '<c-]>', '<cmd>lua vim.lsp.buf.definition()<CR>') | 388 mapper('n', '<c-]>', '<cmd>lua vim.lsp.buf.definition()<CR>') |