From 5631c17614bce2e134dbdb1936525031e55c8682 Mon Sep 17 00:00:00 2001 From: tdro Date: Thu, 4 Nov 2021 01:00:59 -0400 Subject: .vimrc: Merge extension auto commands --- .vimrc | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) (limited to '.vimrc') diff --git a/.vimrc b/.vimrc index a740d5d..fe4fa06 100644 --- a/.vimrc +++ b/.vimrc @@ -298,10 +298,6 @@ augroup AutoCommands autocmd BufWritePost .vimrc source % | Notify('printf "Configuration sourced."') autocmd BufWritePost plugins.vim source % | Notify('printf "Plugins configuration sourced."') - " Linting extension post write commands. - autocmd BufWritePost *.txt,*.md :only | :term ++rows=10 vale % - autocmd BufWritePost *.lit exe 'Notify(''lit ' . expand('%') . ' 2>&1 && printf "Literate OK: ' . expand('%') . '"'')' - " Linting file type post write commands. autocmd FileType php autocmd! BufWritePost exe 'Notify(''phpcbf ' . expand('%') . ' 2>&1'')' | :e autocmd FileType css autocmd! BufWritePost exe 'Notify(''prettier --write --parser css ' . expand('%') . ' 2>&1'')' | :e @@ -324,6 +320,15 @@ augroup AutoCommands autocmd FileType typescript autocmd! BufWritePost exe 'Notify(''deno fmt ' . expand('%') . ' 2>&1 && NO_COLOR=true deno lint ' . expand('%') . ' 2>&1'')' | :e | :only | :term ++rows=10 deno run --config tsconfig.json --allow-all --location https://example.com/ % autocmd FileType sql autocmd! BufWritePost exe 'Notify(''sqlint ' . expand('%') . ' 2>&1 && pg_format -i ' . expand('%') . ' 2>&1 && sqlfluff lint --exclude-rules L003,L016 --dialect postgres ' . expand('%') . ' 2>&1 && printf "SQL OK: ' . expand('%') . '"'')' | :e + " Linting extension post write commands. + autocmd BufWritePost $HOME/.config/chromexup/config.ini exe 'Notify(''chromexup 2>&1'')' + autocmd BufWritePost rc.lua exe 'Notify(''awesome -k 2>&1'')' + autocmd BufWritePost quotes,*.fortune exe 'Notify(''strfile ' . expand('%') . ''')' + autocmd BufWritePost *.lit exe 'Notify(''lit ' . expand('%') . ' 2>&1 && printf "Literate OK: ' . expand('%') . '"'')' + autocmd BufWritePost Xresources exe 'Notify(''xrdb ~/.config/X11/Xresources ' . '2>&1 && printf "Reloading Xresources: ' . expand('%') . '"'')' + autocmd BufWritePost *.desktop exe 'Notify(''desktop-file-validate ' . expand('%') . ' 2>&1 && printf "Deskop File OK: ' . expand('%') . '"'')' + autocmd BufWritePost *.txt,*.md :only | :term ++rows=10 vale % + " File type function under cursor lookups. autocmd FileType go noremap df :exe ':term ++rows=10 go doc ' . expand('') autocmd FileType nix noremap df :exe ':term ++rows=10 nixos-option ' . expand('') @@ -350,13 +355,6 @@ augroup AutoCommands " Set file types. autocmd BufRead,BufNewFile *.nims set filetype=nim - " General auto commands. - autocmd BufWritePost $HOME/.config/chromexup/config.ini exe 'Notify(''chromexup 2>&1'')' - autocmd BufWritePost rc.lua exe 'Notify(''awesome -k 2>&1'')' - autocmd BufWritePost quotes,*.fortune exe 'Notify(''strfile ' . expand('%') . ''')' - autocmd BufWritePost *.desktop exe 'Notify(''desktop-file-validate ' . expand('%') . ' 2>&1 && printf "Deskop File OK: ' . expand('%') . '"'')' - autocmd BufWritePost Xresources exe 'Notify(''xrdb ~/.config/X11/Xresources ' . '2>&1 && printf "Reloading Xresources: ' . expand('%') . '"'')' - " Automatically remove trailing white space on save. autocmd InsertLeave,BufWritePre * %s/\s\+$//e -- cgit v1.2.3