Mercurial > dotfiles
comparison dot_config/nvim/init.lua @ 305:10078cb76622
Add treesitter refactor and textobjects plugins
Allows to rename variables only within the right scope, based on
tree-sitter input
author | zegervdv <zegervdv@me.com> |
---|---|
date | Fri, 20 Nov 2020 18:01:10 +0100 |
parents | f1590ff676ab |
children | 43ee619a8657 |
comparison
equal
deleted
inserted
replaced
304:b2c21071a5ef | 305:10078cb76622 |
---|---|
1 local lsp = require'nvim_lsp' | 1 local lsp = require'nvim_lsp' |
2 | 2 |
3 require "nvim-treesitter.highlight" | 3 require "nvim-treesitter.highlight" |
4 -- local hlmap = vim.treesitter.TSHighlighter.hl_map | |
5 | 4 |
6 require'nvim-treesitter.configs'.setup { | 5 require'nvim-treesitter.configs'.setup { |
7 highlight = { | 6 highlight = { |
8 enable = true, | 7 enable = true, |
9 }, | 8 }, |
30 goto_definition = "gnd", | 29 goto_definition = "gnd", |
31 list_definitions = "gnD", | 30 list_definitions = "gnD", |
32 }, | 31 }, |
33 }, | 32 }, |
34 }, | 33 }, |
34 textobjects = { | |
35 move = { | |
36 enable = true, | |
37 goto_next_start = { | |
38 ["]]"] = "@block.outer", | |
39 }, | |
40 goto_previous_start = { | |
41 ["[["] = "@block.outer", | |
42 }, | |
43 goto_next_end = { | |
44 ["]["] = "@block.outer", | |
45 }, | |
46 goto_previous_end = { | |
47 ["[]"] = "@block.outer", | |
48 }, | |
49 }, | |
50 }, | |
35 playground = { | 51 playground = { |
36 enable = true, | 52 enable = true, |
37 disable = {}, | 53 disable = {}, |
38 updatetime = 25, | 54 updatetime = 25, |
39 persist_queries = false | 55 persist_queries = false |
41 } | 57 } |
42 | 58 |
43 local chain_complete_list = { | 59 local chain_complete_list = { |
44 default = { | 60 default = { |
45 default = { | 61 default = { |
46 {complete_items = {'lsp', 'snippet', 'buffer'}}, | 62 {complete_items = {'lsp', 'snippet', 'ts', 'buffer'}}, |
47 {complete_items = {'path'}, triggered_only = {'/'}}, | 63 {complete_items = {'path'}, triggered_only = {'/'}}, |
48 {complete_items = {'ts'}}, | 64 {complete_items = {'ts'}}, |
49 }, | 65 }, |
50 string = { | 66 string = { |
51 {complete_items = {'path'}, triggered_only = {'/'}}, | 67 {complete_items = {'path'}, triggered_only = {'/'}}, |