aboutsummaryrefslogtreecommitdiff
path: root/.vimrc
diff options
context:
space:
mode:
authortdro <tdro@users.noreply.github.com>2020-07-17 04:00:29 -0400
committertdro <tdro@users.noreply.github.com>2020-07-17 04:00:29 -0400
commit87583fe1f503bffe4327035e1191692740a9e427 (patch)
tree9d309d0532ace7df17a3b77b161668a22d9de410 /.vimrc
parent1908be48b67204601eabe46f80ce2cfb9ffdddd3 (diff)
downloaddotfiles-87583fe1f503bffe4327035e1191692740a9e427.tar.gz
dotfiles-87583fe1f503bffe4327035e1191692740a9e427.tar.bz2
dotfiles-87583fe1f503bffe4327035e1191692740a9e427.zip
.vimrc: Add Nix formatter
Diffstat (limited to '.vimrc')
-rw-r--r--.vimrc7
1 files changed, 6 insertions, 1 deletions
diff --git a/.vimrc b/.vimrc
index b11e2ac..a077157 100644
--- a/.vimrc
+++ b/.vimrc
@@ -131,6 +131,11 @@ function! ShellCheck()
:silent !notify-send -t 10000 "$(shellcheck -x --exclude=SC1090,SC1091 % && echo 'Shellcheck OK: %')" >/dev/null 2>&1 &
endfunction
+" Nix Check
+function! ShellCheck()
+ :silent !notify-send -t 10000 "$(nix-linter % 2>&1 && echo 'Nix Lint OK: %' && nixfmt %)" >/dev/null 2>&1
+endfunction
+
"---------------Shortcuts---------------"
@@ -281,7 +286,7 @@ augroup AutoCommands
autocmd BufWritePost *.js :call ESLintFix()
autocmd BufWritePost *.yml :call AnsibleCheck()
autocmd FileType bash,sh autocmd! BufWritePost <buffer> :call ShellCheck()
- autocmd FileType nix autocmd! BufWritePost <buffer> :silent !notify-send -t 10000 "$(nix-linter % 2>&1 && echo 'Nix Lint OK: %')" >/dev/null 2>&1 &
+ autocmd FileType nix autocmd! BufWritePost <buffer> silent call NixCheck()
" REPL commands
autocmd FileType go noremap <buffer> <leader>cc :Repl gore<cr>