From aaaa4d072a077adb8f5477bc09a00d29bef1a2a7 Mon Sep 17 00:00:00 2001 From: Andrew Miner Date: Mon, 21 Sep 2026 14:56:31 -0600 Subject: [PATCH] Enclose custom auto commands in groups --- home/.vimrc | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/home/.vimrc b/home/.vimrc index 148f1d9..972b9d3 100644 --- a/home/.vimrc +++ b/home/.vimrc @@ -308,15 +308,21 @@ silent! source .vimrc.local " project specific .vimrc " File-Type Specific Settings ###################################################################### -autocmd BufRead COMMIT_EDITMSG set textwidth=70 colorcolumn=70 -autocmd BufRead Makefile setlocal noexpandtab -autocmd BufRead *.scss setlocal shiftwidth=4 -autocmd BufNewFile,BufRead *.md Wrapwidth 100 | setlocal textwidth=0 spell wrap -autocmd WinResized *.md Wrapwidth 100 -autocmd FileType * setlocal formatoptions-=c formatoptions-=r formatoptions-=o +augroup file-specific + autocmd! + autocmd BufRead COMMIT_EDITMSG set textwidth=70 colorcolumn=70 + autocmd BufRead Makefile setlocal noexpandtab + autocmd BufRead *.scss setlocal shiftwidth=4 + autocmd BufNewFile,BufRead *.md Wrapwidth 100 | setlocal textwidth=0 spell wrap + autocmd WinResized *.md Wrapwidth 100 + autocmd FileType * setlocal formatoptions-=c formatoptions-=r formatoptions-=o +augroup END " Startup Commands ################################################################################# -autocmd VimEnter * if argc() == 0 | NERDTree | wincmd p | vertical resize 111 -autocmd CursorHold,FocusLost * silent! wall -autocmd FileType qf execute "resize " . float2nr(&lines * 1 / 3) +augroup startup + autocmd! + autocmd VimEnter * if argc() == 0 | NERDTree | wincmd p | vertical resize 111 + autocmd CursorHold,FocusLost * silent! wall + autocmd FileType qf execute "resize " . float2nr(&lines * 1 / 3) +augroup END