From 7edcb8133bfd469458f94039021d74258b3bf72c Mon Sep 17 00:00:00 2001 From: Robert Günzler Date: Mon, 1 Jun 2020 18:14:07 +0200 Subject: vim: remove coc and add nvim-lsp+compl --- .vim/after/plugin/coc.vim | 86 ----------------------------------------------- .vim/after/plugin/lsp.vim | 25 -------------- 2 files changed, 111 deletions(-) delete mode 100644 .vim/after/plugin/coc.vim delete mode 100644 .vim/after/plugin/lsp.vim (limited to '.vim/after') 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 = '' -let g:coc_snippet_prev = '' - -function! s:check_back_space() abort - let col = col('.') - 1 - return !col || getline('.')[col - 1] =~# '\s' -endfunction - -" inoremap -" \ pumvisible() ? "\" : -" \ check_back_space() ? "\" : -" \ coc#refresh() -inoremap - \ pumvisible() ? coc#_select_confirm() : - \ coc#expandableOrJumpable() ? "\=coc#rpc#request('doKeymap', ['snippets-expand-jump',''])\" : - \ check_back_space() ? "\" : - \ coc#refresh() - -inoremap pumvisible() ? "\" : "\" -inoremap pumvisible() ? "\" : "\u\" -inoremap coc#refresh() - -vmap (coc-snippets-select) - -nmap [c (coc-diagnostic-next) -nmap ]c (coc-diagnostic-prev) -nmap lc :CocList diagnostics - -imap (coc-complete-custom) -nmap d (coc-definition) -nmap t (coc-type-definition) -nmap i (coc-implementation) -nmap r (coc-references) -nmap rn (coc-rename) -nmap qf (coc-fix-current) -nmap ac (coc-codeaction) - -xmap f (coc-format-selected) -nmap f (coc-format-selected) - -xmap a (coc-codeaction-current) -nmap a (coc-codeaction-current) -nmap ac (coc-codeaction) - -nmap o :CocList outline - -function! s:show_doc() - if (index(['vim', 'help'], &filetype) >= 0) - execute 'h ' . expand('') - else - call CocAction('doHover') - endif -endfunction -nmap i :silent! call show_doc() - -au CursorHold * silent call CocActionAsync('highlight') - -command! -nargs=0 Format :call CocAction('format') -command! -nargs=? Fold :call CocAction('fold', ) - -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 gd :call lsp#text_document_definition() -nnoremap gdc :call lsp#text_document_declaration() -nnoremap gt :call lsp#text_document_type_definition() -nnoremap gi :call lsp#text_document_implementation() -nnoremap ;h :call lsp#text_document_hover() -nnoremap ;s :call lsp#text_document_signature_help() -- cgit 1.4.1