aboutsummaryrefslogtreecommitdiff
path: root/.vim/after/plugin/lsp.vim
diff options
context:
space:
mode:
authorGuangxiong Lin <[email protected]>2023-04-11 20:54:00 +0800
committerGuangxiong Lin <[email protected]>2023-04-11 20:54:00 +0800
commitbf3214c56c16f759efdcb9be0dadf37ec59e9e76 (patch)
tree07f6a77249841f3d9dadf31f3ecbac813f538069 /.vim/after/plugin/lsp.vim
parent40e994bcc68f2999b0f8c481f292d74031f88b91 (diff)
downloaddotfiles-bf3214c56c16f759efdcb9be0dadf37ec59e9e76.tar.gz
dotfiles-bf3214c56c16f759efdcb9be0dadf37ec59e9e76.tar.bz2
dotfiles-bf3214c56c16f759efdcb9be0dadf37ec59e9e76.zip
Update vim config
Diffstat (limited to '.vim/after/plugin/lsp.vim')
-rw-r--r--.vim/after/plugin/lsp.vim5
1 files changed, 5 insertions, 0 deletions
diff --git a/.vim/after/plugin/lsp.vim b/.vim/after/plugin/lsp.vim
index c2293f1..702be8f 100644
--- a/.vim/after/plugin/lsp.vim
+++ b/.vim/after/plugin/lsp.vim
@@ -5,6 +5,7 @@ endif
let g:lsp_diagnostics_enabled = 0
let g:lsp_document_code_action_signs_enabled = 0
let g:lsp_use_native_client = 1
+let g:lsp_fold_enabled = 1
packadd vim-lsp
packadd vim-lsp-snippets
@@ -85,6 +86,10 @@ function! s:on_lsp_buffer_enabled() abort
nmap <buffer> <leader>rn <plug>(lsp-rename)
nmap <buffer> K <plug>(lsp-hover)
+ setlocal foldmethod=expr
+ \ foldexpr=lsp#ui#vim#folding#foldexpr()
+ \ foldtext=lsp#ui#vim#folding#foldtext()
+
let g:lsp_format_sync_timeout = 1000
autocmd! BufWritePre *.rs,*.go call execute('LspDocumentFormatSync')
endfunction