diff options
| author | Robert Günzler <r@gnzler.io> | 2020-06-01 18:14:07 +0200 |
|---|---|---|
| committer | Robert Günzler <r@gnzler.io> | 2020-06-01 18:32:20 +0200 |
| commit | 7edcb8133bfd469458f94039021d74258b3bf72c (patch) | |
| tree | 87b5f578c03dba0ad8da5fa95e6184cd5aef092d /.vim/after | |
| parent | 8367490e2637385aae3984696c71949b640c8fc4 (diff) | |
vim: remove coc and add nvim-lsp+compl
Diffstat (limited to '.vim/after')
| -rw-r--r-- | .vim/after/plugin/coc.vim | 86 | ||||
| -rw-r--r-- | .vim/after/plugin/lsp.vim | 25 |
2 files changed, 0 insertions, 111 deletions
diff --git a/.vim/after/plugin/coc.vim b/.vim/after/plugin/coc.vim deleted file mode 100644 index c0e8f38..0000000 --- a/.vim/after/plugin/coc.vim +++ /dev/null @@ -1,86 +0,0 @@ -" coc json config -> ../../coc-settings.json -finish - -if !exists('g:did_coc_loaded') - finish -endif - -set completeopt=noinsert,menuone,noselect -set completeopt-=preview -set shortmess+=c -" set showmatch - -" let g:coc_auto_copen = 1 -let g:coc_snippet_next = '<Tab>' -let g:coc_snippet_prev = '<S-Tab>' - -function! s:check_back_space() abort - let col = col('.') - 1 - return !col || getline('.')[col - 1] =~# '\s' -endfunction - -" inoremap <silent><expr> <Tab> -" \ pumvisible() ? "\<C-n>" : -" \ <SID>check_back_space() ? "\<Tab>" : -" \ coc#refresh() -inoremap <silent><expr> <Tab> - \ pumvisible() ? coc#_select_confirm() : - \ coc#expandableOrJumpable() ? "\<C-r>=coc#rpc#request('doKeymap', ['snippets-expand-jump',''])\<CR>" : - \ <SID>check_back_space() ? "\<Tab>" : - \ coc#refresh() - -inoremap <expr> <S-Tab> pumvisible() ? "\<C-p>" : "\<C-h>" -inoremap <expr> <CR> pumvisible() ? "\<C-y>" : "\<C-g>u\<CR>" -inoremap <silent><expr> <C-Space> coc#refresh() - -vmap <Tab> <Plug>(coc-snippets-select) - -nmap <silent> [c <Plug>(coc-diagnostic-next) -nmap <silent> ]c <Plug>(coc-diagnostic-prev) -nmap <leader>lc :CocList diagnostics<CR> - -imap <silent> <C-p> <Plug>(coc-complete-custom) -nmap <leader>d <Plug>(coc-definition) -nmap <leader>t <Plug>(coc-type-definition) -nmap <leader>i <Plug>(coc-implementation) -nmap <leader>r <Plug>(coc-references) -nmap <leader>rn <Plug>(coc-rename) -nmap <leader>qf <Plug>(coc-fix-current) -nmap <leader>ac <Plug>(coc-codeaction) - -xmap <leader>f <Plug>(coc-format-selected) -nmap <leader>f <Plug>(coc-format-selected) - -xmap <leader>a <Plug>(coc-codeaction-current) -nmap <leader>a <Plug>(coc-codeaction-current) -nmap <leader>ac <Plug>(coc-codeaction) - -nmap <Leader>o :CocList outline<CR> - -function! s:show_doc() - if (index(['vim', 'help'], &filetype) >= 0) - execute 'h ' . expand('<cword>') - else - call CocAction('doHover') - endif -endfunction -nmap <Leader>i :silent! call <SID>show_doc()<CR> - -au CursorHold * silent call CocActionAsync('highlight') - -command! -nargs=0 Format :call CocAction('format') -command! -nargs=? Fold :call CocAction('fold', <f-args>) - -let g:lightline.component_function.coc = 'LightLineCocStatus' -function! LightLineCocStatus() - let info = get(b:, 'coc_diagnostic_info', {}) - if empty(info) | return '' | endif - let msgs = [] - if get(info, 'error', 0) - call add(msgs, '✘ ' . info['error']) - endif - if get(info, 'warning', 0) - call add(msgs, '‼ ' . info['warning']) - endif - return 'coc: ' . join(msgs, ' ') -endfunction diff --git a/.vim/after/plugin/lsp.vim b/.vim/after/plugin/lsp.vim deleted file mode 100644 index ffdea10..0000000 --- a/.vim/after/plugin/lsp.vim +++ /dev/null @@ -1,25 +0,0 @@ -if !has('nvim-0.5.0') - " echoerr 'nvim_lsp only works with neovim>=0.5.0' - finish -endif - -lua << EOF -local lsp = require 'nvim_lsp' -local util = require 'nvim_lsp/util' -local compl = require 'completion' - -lsp.gopls.setup{ - on_attach = compl.on_attach; - root_dir = util.root_pattern("go.mod"); -} -EOF - -" autocmd Filetype bash,shell,css,go,python,rust,tex,latex setl omnifunc=lsp#omnifunc -" au Filetype lua setl omnifunc=v:lua.vim.lsp.omnifunc - -nnoremap <silent> gd :call lsp#text_document_definition()<CR> -nnoremap <silent> gdc :call lsp#text_document_declaration()<CR> -nnoremap <silent> gt :call lsp#text_document_type_definition()<CR> -nnoremap <silent> gi :call lsp#text_document_implementation()<CR> -nnoremap <silent> ;h :call lsp#text_document_hover()<CR> -nnoremap <silent> ;s :call lsp#text_document_signature_help()<CR> |