From c91bc341ca4f6c02ce695882ba3f98d17fc47480 Mon Sep 17 00:00:00 2001 From: surtur Date: Thu, 6 Oct 2022 15:42:55 +0200 Subject: [PATCH] vimrc: add augroup for lsp format sync --- .vim/vimrc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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