diff --git a/autoformat.vim b/autoformat.vim new file mode 100644 index 0000000..dfc089a --- /dev/null +++ b/autoformat.vim @@ -0,0 +1,4 @@ +au BufWrite * :Autoformat +" see here for instructions to get scalafmt set up +let g:formatdef_scalafmt = '"ng-nailgun scalafmt"' +let g:formatters_scala = ['scalafmt'] diff --git a/ftplugin/rust.vim b/ftplugin/rust.vim index 7ec2b5c..13e7a13 100644 --- a/ftplugin/rust.vim +++ b/ftplugin/rust.vim @@ -1 +1,2 @@ -let g:autofmt_autosave = 1 +let g:formatdef_rustfmt_force = '"rustfmt --force"' +let g:formatters_rust = ['rustfmt_force'] diff --git a/plug.vim b/plug.vim index db2f701..0d8395c 100644 --- a/plug.vim +++ b/plug.vim @@ -45,6 +45,9 @@ Plug 'vim-scripts/groovy.vim' Plug 'vim-scripts/groovyindent-unix' " LSP Plug 'autozimu/LanguageClient-neovim', {'tag': 'binary-*-x86_64-unknown-linux-musl'} +" auto format all the things +" https://github.com/Chiel92/vim-autoformat +Plug 'Chiel92/vim-autoformat' " All of your Plugins must be added before the following line call plug#end() " required diff --git a/vimrc b/vimrc index 6dcd774..7e00a51 100644 --- a/vimrc +++ b/vimrc @@ -16,6 +16,7 @@ source mapping.vim source jsonnet.vim source racer.vim source lsp.vim +source autoformat.vim exec "cd " . oldwd " turn on file type plugins