Browse Source

Wrap vim autocmd inside augroups

master
Riyyi 6 years ago
parent
commit
fd1d4b4960
  1. 4
      .config/vim/ftplugin/tex.vim
  2. 8
      .config/vim/vimrc

4
.config/vim/ftplugin/tex.vim

@ -21,4 +21,6 @@ noremap <F7> <Esc>:setlocal spell spelllang=en_us,nl<CR>
noremap <F8> <Esc>:setlocal nospell<CR>
" Start spell check when vim is run
autocmd VimEnter * call feedkeys("\<F7>")
augroup SpellCheck
autocmd! VimEnter * call feedkeys("\<F7>")
augroup END

8
.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 <buffer> %s/\s\+$//e
augroup TrailingWhitespace
autocmd! FileType c,cpp,ino,java,py,php,sh,tex autocmd BufWritePre <buffer> %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

Loading…
Cancel
Save