From ae0c740886ce0275eae716f1ad6ee3d17900d67f Mon Sep 17 00:00:00 2001 From: tdro Date: Fri, 30 Oct 2020 03:12:44 -0400 Subject: .vimrc: Add elixir format --- .vimrc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to '.vimrc') diff --git a/.vimrc b/.vimrc index 956413b..18970be 100644 --- a/.vimrc +++ b/.vimrc @@ -137,6 +137,12 @@ function! NixCheck() :redraw! endfunction +" Elixir Format +function! ElixirFormat() + :silent !notify-send -t 10000 "$(mix format % 2>&1 && echo 'Elixir Format OK: %')" >/dev/null 2>&1 + :redraw! +endfunction + "---------------Shortcuts---------------" @@ -306,13 +312,14 @@ augroup AutoCommands " Linting auto commands. autocmd BufWritePost *.php :call PHPFix() autocmd BufWritePost *.js :call ESLintFix() + autocmd BufWritePost *.ex :call ElixirFormat() autocmd BufWritePost *.yml :call AnsibleCheck() autocmd BufWritePost *.txt,*.md :only | :term ++rows=10 vale-wrapper % autocmd FileType bash,sh autocmd! BufWritePost :call ShellCheck() autocmd FileType nix autocmd! BufWritePost silent call NixCheck() autocmd FileType rust autocmd! BufWritePost silent !notify-send "$(rustfmt % 2>&1 && echo 'rustfmt OK:' %)" - " REPL commands + " REPL commands. autocmd FileType go noremap cc :REPL gore autocmd FileType lua noremap cc :REPL lua autocmd FileType php noremap cc :REPL psysh -- cgit v1.2.3