Created
July 9, 2013 13:44
-
-
Save cesarferreira/5957460 to your computer and use it in GitHub Desktop.
My personal vimrc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
au BufNewFile,BufRead *.cu set ft=cu | |
set number | |
syntax on | |
set mouse=a | |
set wildmode=list:longest " turn on wild mode huge list | |
set cursorline " highlight current line | |
set ruler | |
set showmatch | |
set showcmd " show the command being typed | |
set autoindent | |
set autoread | |
set ts=2 | |
set sm | |
" Enhanced keyboard mappings | |
" | |
" in normal mode F2 will save the file | |
nmap <F2> :w<CR> | |
" in insert mode F2 will exit insert, save, enters insert again | |
imap <F2> <ESC>:w<CR>i | |
" switch between header/source with F4 | |
map <F4> :e %:p:s,.h$,.X123X,:s,.cpp$,.h,:s,.X123X$,.cpp,<CR> | |
" recreate tags file with F5 | |
map <F5> :!ctags -R –c++-kinds=+p –fields=+iaS –extra=+q .<CR> | |
" create doxygen comment | |
map <F6> :Dox<CR> | |
" build using makeprg with <F7> | |
map <F7> :make<CR> | |
" build using makeprg with <S-F7> | |
map <S-F7> :make clean all<CR> | |
" goto definition with F12 | |
map <F12> <C-]> | |
" in diff mode we use the spell check keys for merging | |
if &diff | |
" diff settings | |
map <M-Down> ]c | |
map <M-Up> [c | |
map <M-Left> do | |
map <M-Right> dp | |
map <F9> :new<CR>:read !svn diff<CR>:set syntax=diff buftype=nofile<CR>gg | |
else | |
" spell settings | |
:setlocal spell spelllang=en | |
" set the spellfile - folders must exist | |
set spellfile=~/.vim/spellfile.add | |
map <M-Down> ]s | |
map <M-Up> [s | |
endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment