diff --git a/init.vim b/init.vim index e160853..3d9acd8 100644 --- a/init.vim +++ b/init.vim @@ -52,23 +52,28 @@ set foldmethod=syntax set scrolloff=7 " CoC settings +function! CheckBackspace() abort + let col = col('.') - 1 + return !col || getline('.')[col - 1] =~# '\s' +endfunction + inoremap \ coc#pum#visible() ? coc#pum#next(1) : + \ coc#expandableOrJumpable() ? "\=coc#snippet#next()\" : \ CheckBackspace() ? "\" : \ coc#refresh() -inoremap coc#pum#visible() ? coc#pum#prev(1) : "\" -"inoremap pumvisible() ? "\" : "\" -"inoremap pumvisible() ? "\" : "\" -nmap :CocAction +inoremap + \ coc#pum#visible() ? coc#pum#prev(1) : "\" + \ coc#expandableOrJumpable() ? "\=coc#snippet#prev()\" : + \ CheckBackspace() ? "\" : + \ coc#refresh() let g:coc_disable_startup_warning = 1 inoremap coc#pum#visible() ? coc#pum#confirm() \: "\u\\=coc#on_enter()\" -function! CheckBackspace() abort - let col = col('.') - 1 - return !col || getline('.')[col - 1] =~# '\s' -endfunction +let g:coc_snippet_next = '' +let g:coc_snippet_prev = '' func! s:my_colors_setup() abort " this is an example @@ -85,6 +90,19 @@ nmap [g (coc-diagnostic-prev) nmap ]g (coc-diagnostic-next) nmap ]f (coc-fix-current) +" Symbol renaming +nmap rn (coc-rename) + +" GoTo code navigation +nmap gd (coc-definition) +nmap gy (coc-type-definition) +nmap gi (coc-implementation) +nmap gr (coc-references) + +" Temporary!!! Remove after CoC update +let storage_file = stdpath('data') . '/coc-localstorage' +let g:coc_node_args = ['--localstorage-file=' . storage_file] + " syntax highlighting syntax on set background=dark