diff --git a/.config/vim/ftplugin/tex.vim b/.config/vim/ftplugin/tex.vim index f5f3bc0..459dd94 100644 --- a/.config/vim/ftplugin/tex.vim +++ b/.config/vim/ftplugin/tex.vim @@ -21,4 +21,6 @@ noremap :setlocal spell spelllang=en_us,nl noremap :setlocal nospell " Start spell check when vim is run -autocmd VimEnter * call feedkeys("\") +augroup SpellCheck + autocmd! VimEnter * call feedkeys("\") +augroup END diff --git a/.config/vim/vimrc b/.config/vim/vimrc index c877c3a..38cee9a 100644 --- a/.config/vim/vimrc +++ b/.config/vim/vimrc @@ -93,10 +93,14 @@ let g:vimtex_view_method = 'zathura' "" Autocommands " Remove trailing whitespace in the following filetypes -autocmd FileType c,cpp,ino,java,py,php,sh,tex autocmd BufWritePre %s/\s\+$//e +augroup TrailingWhitespace + autocmd! FileType c,cpp,ino,java,py,php,sh,tex autocmd BufWritePre %s/\s\+$//e +augroup END " Close vim if only window is NERD Tree -autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif +augroup CloseVimTree + autocmd! bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif +augroup END "" Functions