aboutsummaryrefslogtreecommitdiff
path: root/.vimrc
diff options
context:
space:
mode:
authortdro <tdro@users.noreply.github.com>2021-11-04 01:00:59 -0400
committertdro <tdro@users.noreply.github.com>2021-11-04 01:00:59 -0400
commit5631c17614bce2e134dbdb1936525031e55c8682 (patch)
treeba5580da51ddb0925b7839f4d24a8debe048b92b /.vimrc
parent14b56c5e36125e0de7afb9a321bbba10a8662587 (diff)
downloaddotfiles-5631c17614bce2e134dbdb1936525031e55c8682.tar.gz
dotfiles-5631c17614bce2e134dbdb1936525031e55c8682.tar.bz2
dotfiles-5631c17614bce2e134dbdb1936525031e55c8682.zip
.vimrc: Merge extension auto commands
Diffstat (limited to '.vimrc')
-rw-r--r--.vimrc20
1 files changed, 9 insertions, 11 deletions
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 <buffer> exe 'Notify(''phpcbf ' . expand('%') . ' 2>&1'')' | :e
autocmd FileType css autocmd! BufWritePost <buffer> exe 'Notify(''prettier --write --parser css ' . expand('%') . ' 2>&1'')' | :e
@@ -324,6 +320,15 @@ augroup AutoCommands
autocmd FileType typescript autocmd! BufWritePost <buffer> 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 <buffer> 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 <buffer> <leader>df :exe ':term ++rows=10 go doc ' . expand('<cexpr>')<cr>
autocmd FileType nix noremap <buffer> <leader>df :exe ':term ++rows=10 nixos-option ' . expand('<cexpr>')<cr>
@@ -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