aboutsummaryrefslogtreecommitdiff
path: root/.vim/plugins/lsp.plug
diff options
context:
space:
mode:
authorgxlin <[email protected]>2021-07-15 21:28:06 +0800
committergxlin <[email protected]>2021-07-15 21:28:06 +0800
commitd4e1469e4b0c5aaf5c23be555e8b224f9254d781 (patch)
treee68a0e5dd44ee43efc2d70c081f41ae3237a78c1 /.vim/plugins/lsp.plug
parent36f249e1a7250e24f0c415b5bc53ba1b2f5806d4 (diff)
downloaddotfiles-d4e1469e4b0c5aaf5c23be555e8b224f9254d781.tar.gz
dotfiles-d4e1469e4b0c5aaf5c23be555e8b224f9254d781.tar.bz2
dotfiles-d4e1469e4b0c5aaf5c23be555e8b224f9254d781.zip
A usable boostrap config
Diffstat (limited to '.vim/plugins/lsp.plug')
-rw-r--r--.vim/plugins/lsp.plug39
1 files changed, 0 insertions, 39 deletions
diff --git a/.vim/plugins/lsp.plug b/.vim/plugins/lsp.plug
deleted file mode 100644
index 1a5704b..0000000
--- a/.vim/plugins/lsp.plug
+++ /dev/null
@@ -1,39 +0,0 @@
-Plug 'prabirshrestha/vim-lsp'
-
-if executable('gopls')
- au User lsp_setup call lsp#register_server({
- \ 'name': 'gopls',
- \ 'cmd': {server_info->['gopls']},
- \ 'allowlist': ['go'],
- \ })
-endif
-
-function! s:on_lsp_buffer_enabled() abort
- setlocal omnifunc=lsp#complete
- setlocal signcolumn=no
- if exists('+tagfunc') | setlocal tagfunc=lsp#tagfunc | endif
- nmap <buffer> gd <plug>(lsp-definition)
- nmap <buffer> gs <plug>(lsp-document-symbol-search)
- nmap <buffer> gS <plug>(lsp-workspace-symbol-search)
- nmap <buffer> gr <plug>(lsp-references)
- nmap <buffer> gi <plug>(lsp-implementation)
- nmap <buffer> gt <plug>(lsp-type-definition)
- nmap <buffer> <leader>rn <plug>(lsp-rename)
- nmap <buffer> [g <plug>(lsp-previous-diagnostic)
- nmap <buffer> ]g <plug>(lsp-next-diagnostic)
- nmap <buffer> K <plug>(lsp-hover)
- inoremap <buffer> <expr><c-f> lsp#scroll(+4)
- inoremap <buffer> <expr><c-d> lsp#scroll(-4)
-
- let g:lsp_format_sync_timeout = 1000
- autocmd! BufWritePre *.rs,*.go call execute('LspDocumentFormatSync')
-
- " refer to doc to add more commands
-endfunction
-
-augroup lsp_install
- au!
- " call s:on_lsp_buffer_enabled only for languages that has the server registered.
- autocmd User lsp_buffer_enabled call s:on_lsp_buffer_enabled()
-augroup END
-