comparison dot_config/nvim/init.vim @ 278:7daae1b70617

Add treesitter config for python
author zegervdv <zegervdv@me.com>
date Mon, 24 Aug 2020 21:50:33 +0200
parents a567e547b45a
children dd8b9d0c0e41
comparison
equal deleted inserted replaced
277:a567e547b45a 278:7daae1b70617
115 " Plug 'neoclide/coc.nvim', { 'branch': 'release' } 115 " Plug 'neoclide/coc.nvim', { 'branch': 'release' }
116 " Plug 'neoclide/coc-sources' 116 " Plug 'neoclide/coc-sources'
117 Plug 'neovim/nvim-lsp' 117 Plug 'neovim/nvim-lsp'
118 Plug 'nvim-lua/completion-nvim' 118 Plug 'nvim-lua/completion-nvim'
119 Plug 'nvim-lua/diagnostic-nvim' 119 Plug 'nvim-lua/diagnostic-nvim'
120 Plug 'nvim-treesitter/nvim-treesitter'
120 endif 121 endif
121 122
122 " Copying 123 " Copying
123 Plug 'ShikChen/osc52.vim' 124 Plug 'ShikChen/osc52.vim'
124 125
1246 " }}} 1247 " }}}
1247 " Background make {{{ 1248 " Background make {{{
1248 nnoremap <F9> :PMake<CR> 1249 nnoremap <F9> :PMake<CR>
1249 " }}} 1250 " }}}
1250 " LanguageClient {{{ 1251 " LanguageClient {{{
1251 nmap <silent> gd <Plug>(coc-definition) 1252
1252 nmap <silent> gy <Plug>(coc-type-definition)
1253 nmap <silent> gi <Plug>(coc-implementation)
1254 nmap <silent> gr <Plug>(coc-references)
1255
1256 " Use K to show documentation in preview window
1257 nnoremap <silent> K :call <SID>show_documentation()<CR>
1258
1259 function! s:show_documentation()
1260 if (index(['vim','help'], &filetype) >= 0)
1261 execute 'h '.expand('<cword>')
1262 else
1263 call CocAction('doHover')
1264 endif
1265 endfunction
1266 " }}} 1253 " }}}
1267 " Splice {{{ 1254 " Splice {{{
1268 let g:splice_initial_diff_grid=1 1255 let g:splice_initial_diff_grid=1
1269 let g:splice_initial_diff_compare=1 1256 let g:splice_initial_diff_compare=1
1270 let g:splice_initial_diff_path=0 1257 let g:splice_initial_diff_path=0
1294 " augroup fmt 1281 " augroup fmt
1295 " autocmd! 1282 " autocmd!
1296 " autocmd BufWritePre * try | undojoin | Neoformat | catch /^Vim\%((\a\+)\)\=:E790/ | finally | silent Neoformat | endtry 1283 " autocmd BufWritePre * try | undojoin | Neoformat | catch /^Vim\%((\a\+)\)\=:E790/ | finally | silent Neoformat | endtry
1297 " augroup END 1284 " augroup END
1298 " }}} 1285 " }}}
1286 lua <<EOF
1287 require'nvim-treesitter.configs'.setup {
1288 highlight = {
1289 enable = true,
1290 },
1291 incremental_selection = {
1292 enable = true,
1293 keymaps = {
1294 init_selection = "gnn",
1295 node_incremental = "grn",
1296 scope_incremental = "grc",
1297 node_decremental = "grm",
1298 }
1299 },
1300 refactor = {
1301 smart_rename = {
1302 enable = true,
1303 keymaps = {
1304 smart_rename = "grr",
1305 },
1306 },
1307 navigation = {
1308 enable = true,
1309 keymaps = {
1310 goto_definition = "gnd",
1311 list_definitions = "gnD",
1312 },
1313 },
1314 },
1315 }
1316 EOF
1299 " }}} 1317 " }}}
1300 1318
1301 function! SendOSCClipboard(lines, regtype) 1319 function! SendOSCClipboard(lines, regtype)
1302 call SendViaOSC52(join(a:lines, "\n")) 1320 call SendViaOSC52(join(a:lines, "\n"))
1303 endfunction 1321 endfunction