aboutsummaryrefslogtreecommitdiff
path: root/.vimrc
diff options
context:
space:
mode:
authortdro <tdro@users.noreply.github.com>2020-10-30 03:12:44 -0400
committertdro <tdro@users.noreply.github.com>2020-10-30 03:12:44 -0400
commitae0c740886ce0275eae716f1ad6ee3d17900d67f (patch)
treecfc75986cfdb9dacb218807ff40223ba13eb9653 /.vimrc
parent82c264220a7b21b3caaef46f7517e6d98802e8a0 (diff)
downloaddotfiles-ae0c740886ce0275eae716f1ad6ee3d17900d67f.tar.gz
dotfiles-ae0c740886ce0275eae716f1ad6ee3d17900d67f.tar.bz2
dotfiles-ae0c740886ce0275eae716f1ad6ee3d17900d67f.zip
.vimrc: Add elixir format
Diffstat (limited to '.vimrc')
-rw-r--r--.vimrc9
1 files changed, 8 insertions, 1 deletions
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 <buffer> :call ShellCheck()
autocmd FileType nix autocmd! BufWritePost <buffer> silent call NixCheck()
autocmd FileType rust autocmd! BufWritePost <buffer> silent !notify-send "$(rustfmt % 2>&1 && echo 'rustfmt OK:' %)"
- " REPL commands
+ " REPL commands.
autocmd FileType go noremap <buffer> <leader>cc :REPL gore<cr>
autocmd FileType lua noremap <buffer> <leader>cc :REPL lua<cr>
autocmd FileType php noremap <buffer> <leader>cc :REPL psysh<cr>