|
|
Editor Configuration
|
|
|
====================
|
|
|
|
|
|
In this article, we provide some editor configuration files which comply to our programming style. Feel free to download and use them.
|
|
|
|
|
|
VIM
|
|
|
---
|
|
|
|
|
|
Here is an example configuration file for VIM. It is configures the maximum line-width, indent-width, automatic white-space removal and the doxygen toolkit.
|
|
|
|
|
|
set tabstop=4
|
|
|
set softtabstop=4
|
|
|
set shiftwidth=4
|
|
|
|
|
|
" Enable spellchecking the comments
|
|
|
set spelllang=en
|
|
|
|
|
|
" Syntax based folding
|
|
|
set foldmethod=syntax
|
|
|
normal! zR
|
|
|
|
|
|
" Compilation
|
|
|
let &mp='make -C ../build/debug'
|
|
|
|
|
|
" Length of lines should be limited to 150
|
|
|
set textwidth=145
|
|
|
set wrapmargin=145
|
|
|
set wrap
|
|
|
set formatoptions+=t " wrap them automatically
|
|
|
|
|
|
" trim trailing spaces
|
|
|
let g:trimwhitepsace_enable = 1
|
|
|
if !exists('g:trimwhitepsace_enable') | let g:trimwhitepsace_enable = 0 | endif
|
|
|
func! TrimWhiteSpace()
|
|
|
exe "normal mz"
|
|
|
%s/\s\+$//ge
|
|
|
exe "normal `z"
|
|
|
exe "normal :delmarks z\n"
|
|
|
endfunc
|
|
|
autocmd FileType c,cpp,java,php,vo_base,python,bash,sh,glsl autocmd BufWritePre :call TrimWhiteSpace()
|
|
|
|
|
|
" Tune DoxygenToolkit
|
|
|
let g:DoxygenToolkit_briefTag_pre=""
|
|
|
let g:DoxygenToolkit_startCommentTag = "/**"
|
|
|
let g:DoxygenToolkit_startCommentBlock = "/*"
|
|
|
let g:DoxygenToolkit_paramTag_pre = "\\param "
|
|
|
let g:DoxygenToolkit_returnTag = "\\return "
|
|
|
let g:DoxygenToolkit_fileTag = "\\file "
|
|
|
let g:DoxygenToolkit_authorTag = "\\author "
|
|
|
let g:DoxygenToolkit_dateTag = "\\date "
|
|
|
let g:DoxygenToolkit_blockTag = "\\name "
|
|
|
let g:DoxygenToolkit_classTag = "\\class "
|
|
|
let g:doxygenToolkit_templateParamTag_pre = "\\tparam "
|
|
|
|
|
|
Eclipse
|
|
|
-------
|
|
|
|
|
|
In Eclipse IDE, you can import the attached style definitions.
|
|
|
|
|
|
Additional information
|
|
|
----------------------
|
|
|
|
|
|
If you want to enable spell checking (for comments and string literals) this page could help if you use emacs, eclipse or vim: http://stackoverflow.com/questions/1289765/spell-checker-for-comments-strings-maybe-more |