Skip to content

Instantly share code, notes, and snippets.

@bergercookie
Last active July 6, 2017 17:23
Show Gist options
  • Save bergercookie/9a2e96e19733b32ca55b8e2940eaba2c to your computer and use it in GitHub Desktop.
Save bergercookie/9a2e96e19733b32ca55b8e2940eaba2c to your computer and use it in GitHub Desktop.
Vim indentation for MRPT
augroup mrpt_indentation
autocmd!
" mrpt uses tabs for indentation
autocmd FileType cpp set tabstop=4
autocmd FileType cpp set shiftwidth=4 " use indents of X spaces
autocmd FileType cpp set preserveindent
autocmd FileType cpp set copyindent
autocmd FileType cpp set softtabstop=0
autocmd FileType cpp set autoindent " indent at the same level of the previous line
autocmd FileType cpp set noexpandtab
" ClangFormat configuration
autocmd FileType cpp nmap <Leader>C :ClangFormatAutoToggle<CR>
autocmd FileType cpp let g:clang_format#command = "/usr/bin/clang-format-3.8"
autocmd FileType cpp let g:clang_format#detect_style_file = 1
autocmd FileType cpp let g:clang_format#auto_format_on_insert_leave = 0
autocmd FileType cpp let g:clang_format#auto_format = 1
autocmd FileType cpp let g:clang_format#auto_formatexpr = 1
autocmd FileType cpp set textwidth=0 " Incompatible with auto_formatexpr=1
augroup END
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment