diff --git a/.vimrc b/.vimrc index 1fb1c41a492fdff218ca0534a0def80fc6675564..164644541536d1a441bf76294ed310a66fe0bdac 100644 --- a/.vimrc +++ b/.vimrc @@ -896,6 +896,10 @@ function! s:check_back_space() abort return !col || getline('.')[col - 1] =~# '\s' endfunction +" CoC +"let g:coc_user_config = {} +"let g:coc_user_config['coc.preferences.jumpCommand'] = 'vsp' + " Use <c-space> to trigger completion. inoremap <silent><expr> <c-space> coc#refresh() @@ -916,6 +920,10 @@ nmap <silent> gy <Plug>(coc-type-definition) nmap <silent> gi <Plug>(coc-implementation) nmap <silent> gr <Plug>(coc-references) +nmap <silent> <leader>gs :call CocAction('jumpDefinition', 'split')<CR> +nmap <silent> <leader>gd :call CocAction('jumpDefinition', 'vsplit')<CR> +nmap <silent> <leader>gt :call CocAction('jumpDefinition', 'tabe')<CR> + nmap <silent> <leader>me <Plug>(coc-command)expandMacro " Use K to show documentation in preview window @@ -936,7 +944,8 @@ autocmd CursorHold * silent call CocActionAsync('highlight') nmap <leader>rn <Plug>(coc-rename) " Project wide rename word -nnoremap <leader>prw :CocSearch <C-R>=expand("<cword>")<CR><CR> +nnoremap <leader>pwr :CocSearch <C-R>=expand("<cword>")<CR><CR> +nnoremap <leader>rw :CocSearch <C-R>=expand("<cword>")<CR><CR> " Remap for format selected region xmap <leader>F <Plug>(coc-format-selected) @@ -1011,6 +1020,7 @@ let g:coc_global_extensions = [ \'coc-rust-analyzer', \'coc-markdownlint', \'coc-yaml', + \'coc-toml', \'coc-pyright', \'coc-diagnostic', \'coc-spell-checker',