Skip to content
This repository has been archived by the owner on Mar 24, 2021. It is now read-only.

Commit

Permalink
feat(autoformat): add autoformat for common languages and bind <Leade…
Browse files Browse the repository at this point in the history
…r>fm for formatting
  • Loading branch information
LER0ever committed Mar 29, 2017
1 parent f1f6fce commit 2989070
Showing 1 changed file with 28 additions and 7 deletions.
35 changes: 28 additions & 7 deletions .vimrc
Original file line number Diff line number Diff line change
Expand Up @@ -450,16 +450,20 @@
" }

" vimwiki {
let g:vimwiki_folding = 'syntax'
map <Leader>vwe :Vimwiki2HTML<CR>
map <Leader>vwb :Vimwiki2HTMLBrowse<CR>
if isdirectory(expand("~/.vim/bundle/vimwiki"))
let g:vimwiki_folding = 'syntax'
map <Leader>vwe :Vimwiki2HTML<CR>
map <Leader>vwb :Vimwiki2HTMLBrowse<CR>
endif
" }

" vim-uncrustify {
autocmd FileType c noremap <buffer> <Leader>fm :call Uncrustify('c')<CR>
autocmd FileType c vnoremap <buffer> <Leader>fm :call RangeUncrustify('c')<CR>
autocmd FileType cpp noremap <buffer> <Leader>fm :call Uncrustify('cpp')<CR>
autocmd FileType cpp vnoremap <buffer> <Leader>fm :call RangeUncrustify('cpp')<CR>
if isdirectory(expand("~/.vim/bundle/vim-uncrustify"))
autocmd FileType c noremap <buffer> <Leader>fm :call Uncrustify('c')<CR>
autocmd FileType c vnoremap <buffer> <Leader>fm :call RangeUncrustify('c')<CR>
autocmd FileType cpp noremap <buffer> <Leader>fm :call Uncrustify('cpp')<CR>
autocmd FileType cpp vnoremap <buffer> <Leader>fm :call RangeUncrustify('cpp')<CR>
endif
" }

" GoLang {
Expand Down Expand Up @@ -671,6 +675,23 @@
endif
" }

" Vim-AutoFormat {
if isdirectory(expand("~/.vim/bundle/vim-autoformat"))
noremap <Leader>fm :Autoformat<CR>
au BufWrite *.c,*.cpp,*.h,*.hpp,*.cxx :Autoformat
au BufWrite *.go :Autoformat
au BufWrite *.rust,*.rs :Autoformat
au BufWrite *.js,*.ts,*.jsx :Autoformat
au BufWrite *.cs :Autoformat
au BufWrite *.sh,*.bash :Autoformat
au BufWrite *.java :Autoformat
au BufWrite *.py :Autoformat
au Bufwrite *.html :Autoformat
au BufWrite *.css :Autoformat
au BufWrite *.ts :Autoformat
endif
" }

" vim-markdown {
let g:vim_markdown_toml_frontmatter = 1
let g:vim_markdown_math = 1
Expand Down

0 comments on commit 2989070

Please sign in to comment.