diff --git a/.vim/vimrc b/.vim/vimrc index 145c9d0..4c0e8ff 100644 --- a/.vim/vimrc +++ b/.vim/vimrc @@ -777,7 +777,10 @@ function! s:on_lsp_buffer_enabled() abort " let g:lsp_format_sync_timeout = 1000 let g:lsp_format_sync_timeout = 700 - autocmd! BufWritePre *.rs,*.go call execute('LspDocumentFormatSync') + augroup lsp_format_sync + autocmd! + autocmd! BufWritePre *.rs,*.go call execute('LspDocumentFormatSync') + augroup END " refer to doc to add more commands endfunction