Google vim-codefmt
Commands
:FormatCode <TAB>
Installation
vim ~/.vimrc
1 2 3 4 5 6 7
| call plug#begin('~/.vim/plugged')
Plug 'google/vim-maktaba' Plug 'google/vim-codefmt' Plug 'google/vim-glaive'
call plug#end()
|
:PlugInstall
vim ~/.vimrc
1 2 3 4 5 6 7 8 9 10
| augroup autoformat_settings autocmd FileType bzl AutoFormatBuffer buildifier autocmd FileType c,cpp,proto,javascript AutoFormatBuffer clang-format autocmd FileType dart AutoFormatBuffer dartfmt autocmd FileType go AutoFormatBuffer gofmt autocmd FileType gn AutoFormatBuffer gn autocmd FileType html,css,sass,scss,less,json AutoFormatBuffer js-beautify autocmd FileType java AutoFormatBuffer google-java-format autocmd FileType python AutoFormatBuffer yapf augroup END
|
sudo apt install clang-format
vim ~/.vimrc
1 2
| call glaive#Install() Glaive codefmt clang_format_executable='/usr/bin/clang-format'
|