vimrc: c++, clang-format

This commit is contained in:
Théophile Bastian 2017-04-03 09:11:59 +02:00
parent d8ad6c2cec
commit cf27d73151

View file

@ -5,7 +5,7 @@ set background=dark
set number set number
set relativenumber set relativenumber
set tabstop=4 set tabstop=4
set softtabstop=4 "set softtabstop=4
set shiftwidth=4 set shiftwidth=4
set expandtab set expandtab
set smartindent set smartindent
@ -18,6 +18,14 @@ set tw=79
set wildmode=longest,list,full set wildmode=longest,list,full
set wildmenu set wildmenu
" Splitting
set splitbelow
set splitright
nnoremap <C-J> <C-W><C-J>
nnoremap <C-K> <C-W><C-K>
nnoremap <C-L> <C-W><C-L>
nnoremap <C-H> <C-W><C-H>
set exrc set exrc
set secure set secure
@ -49,8 +57,9 @@ Plugin 'itchyny/vim-haskell-indent'
Plugin 'junegunn/goyo.vim' Plugin 'junegunn/goyo.vim'
Plugin 'vim-airline/vim-airline' Plugin 'vim-airline/vim-airline'
Plugin 'vim-airline/vim-airline-themes' Plugin 'vim-airline/vim-airline-themes'
Plugin 'davidhalter/jedi-vim' "Plugin 'davidhalter/jedi-vim'
Plugin 'vim-scripts/a.vim' Plugin 'vim-scripts/a.vim'
Plugin 'rhysd/vim-clang-format'
call vundle#end() " required call vundle#end() " required
filetype plugin indent on " required filetype plugin indent on " required
@ -100,6 +109,11 @@ let g:airline_powerline_fonts = 1
let g:airline#extensions#tabline#enabled = 1 let g:airline#extensions#tabline#enabled = 1
set noshowmode set noshowmode
""""""""""""""""" clang-format
let g:clang_format#detect_style_file = 1
autocmd FileType c,cpp,objc nnoremap <buffer><Leader>cf :<C-u>ClangFormat<CR>
autocmd FileType c,cpp,objc vnoremap <buffer><Leader>cf :ClangFormat<CR>
""""""""""""""""" Trailing whitespaces """"""""""""""""" Trailing whitespaces
fun! TrimWhitespace() fun! TrimWhitespace()
let l:save_cursor = getpos('.') let l:save_cursor = getpos('.')