Mercurial > dotfiles
comparison dot_config/nvim/init.vim @ 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 | eaf1cdf558a0 |
children | 49b61215e3d0 |
comparison
equal
deleted
inserted
replaced
304:b2c21071a5ef | 305:10078cb76622 |
---|---|
107 Plug 'honza/vim-snippets' | 107 Plug 'honza/vim-snippets' |
108 if has('nvim') | 108 if has('nvim') |
109 Plug 'neovim/nvim-lsp' | 109 Plug 'neovim/nvim-lsp' |
110 Plug 'nvim-lua/completion-nvim' | 110 Plug 'nvim-lua/completion-nvim' |
111 Plug 'nvim-treesitter/nvim-treesitter' | 111 Plug 'nvim-treesitter/nvim-treesitter' |
112 Plug 'nvim-treesitter/nvim-treesitter-refactor' | |
113 Plug 'nvim-treesitter/nvim-treesitter-textobjects' | |
112 Plug 'nvim-treesitter/playground' | 114 Plug 'nvim-treesitter/playground' |
113 Plug 'steelsojka/completion-buffers' | 115 Plug 'steelsojka/completion-buffers' |
114 Plug 'nvim-treesitter/completion-treesitter' | 116 Plug 'nvim-treesitter/completion-treesitter' |
115 endif | 117 endif |
116 | 118 |
462 noremap <expr> j (v:count? 'j' : 'gj') | 464 noremap <expr> j (v:count? 'j' : 'gj') |
463 noremap <expr> k (v:count? 'k' : 'gk') | 465 noremap <expr> k (v:count? 'k' : 'gk') |
464 | 466 |
465 " Remap tag-search to better place | 467 " Remap tag-search to better place |
466 nnoremap <C-$> g<C-]> | 468 nnoremap <C-$> g<C-]> |
467 nnoremap <C-y> g<C-]> | |
468 nnoremap <C-w>y <C-w>g<C-]> | 469 nnoremap <C-w>y <C-w>g<C-]> |
469 | 470 |
470 nnoremap <C-s> <C-e> | 471 nnoremap <C-s> <C-e> |
471 | 472 |
472 " Move while in insert mode | 473 " Move while in insert mode |
1100 " }}} | 1101 " }}} |
1101 " System Verilog {{{ | 1102 " System Verilog {{{ |
1102 augroup ft_systemverilog | 1103 augroup ft_systemverilog |
1103 au! | 1104 au! |
1104 au FileType systemverilog setlocal suffixesadd+=.sv,.v | 1105 au FileType systemverilog setlocal suffixesadd+=.sv,.v |
1105 au FileType systemverilog setlocal foldmethod=marker | 1106 au FileType systemverilog setlocal foldmethod=expr |
1107 au FileType systemverilog setlocal foldexpr=nvim_treesitter#foldexpr() | |
1106 au FileType systemverilog,verilog call SVAlign() | 1108 au FileType systemverilog,verilog call SVAlign() |
1107 au FileType systemverilog,verilog let b:delimitMate_quotes = "\"" | 1109 au FileType systemverilog,verilog let b:delimitMate_quotes = "\"" |
1108 augroup END | 1110 augroup END |
1109 | 1111 |
1110 function! SVAlign() | 1112 function! SVAlign() |