Files
dot_files/vimrc

105 lines
3.0 KiB
VimL

execute pathogen#infect()
set expandtab
set tabstop=4
set shiftwidth=4
set mouse=nicr
set ttymouse=sgr "Support wide screens
set incsearch
set hlsearch
set ignorecase
set smartcase
set smartindent
set tags=./tags;
:nnoremap <silent> <Space> :nohlsearch<Bar>:echo<CR>
syntax on
filetype plugin indent on
colorscheme apprentice
nnoremap tn :tabnew<CR>
map <C-\> :tab split<CR>:exec("tag ".expand("<cword>"))<CR>
map <A-]> :vsp <CR>:exec("tag ".expand("<cword>"))<CR>
" Load all plugins now.
" Plugins need to be added to runtimepath before helptags can be generated.
" packloadall
" Load all of the helptags now, after plugins have been loaded.
" All messages and errors will be ignored.
silent! helptags ALL
"
if &term =~ '^screen'
" tmux will send xterm-style keys when its xterm-keys option is on
execute "set <xUp>=\e[1;*A"
execute "set <xDown>=\e[1;*B"
execute "set <xRight>=\e[1;*C"
execute "set <xLeft>=\e[1;*D"
endif
" Nerdtree
nnoremap <leader>n :NERDTreeFocus<CR>
nnoremap <C-n> :NERDTreeToggle<CR>
nnoremap <C-f> :NERDTreeFind<CR>
" Taglist
nnoremap <C-l> :TlistToggle<CR>
nnoremap <C-p> :TlistShowPrototype<CR>
let Tlist_Use_Right_Window = 1 " Move window to right side
let Tlist_Exit_OnlyWindow = 1 " Close if only window left
let Tlist_Hightlight_Tag_On_BufEnter = 1 " Hightlight current tag
let Tlist_Display_Prototypte = 1 " Show full prototype at bottom
let Tlist_Ctags_Cmd = 'ctags --extra=-q --c++-kinds=-p'
" vim-rainbow
let g:rainbow_active = 1
let g:rainbow_guifgs = ['RoyalBlue3', 'DarkOrange3', 'DarkOrchid3', 'FireBrick']
let g:rainbow_ctermfgs = ['lightblue', 'lightgreen', 'yellow', 'red', 'magenta']
nnoremap <C-g> :GitGutterToggle<CR>
" OmniCpp
let OmniCpp_MayCompleteDot = 0
let OmniCpp_MayCompleteArrow = 0
" set omnifunc=syntaxcomplete#Complete
" Supertab
let g:SuperTabDefaultCompletionType = "<c-x><c-]>"
" Fugitive conflict resolution
nnoremap <leader>gd :Gvdiff<CR>
nnoremap gdh :diffget //2<CR>
nnoremap gdl :diffget //3<CR>
" YAML editor settings
autocmd FileType yaml setlocal ts=2 sts=2 sw=2 expandtab
autocmd FileType yml setlocal ts=2 sts=2 sw=2 expandtab
let g:indentLine_char = '┆'
let g:indentLine_color_term = 237
" Syntastic
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*
let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 1
let g:syntastic_check_on_open = 0
let g:syntastic_check_on_wq = 0
nnoremap <C-y> :SyntasticToggleMode<CR>
"" Optional. Configure before enabling
" let g:syntastic_cpp_checkers = ['clang_tidy']
" let g:syntastic_c_checkers = ['clang_tidy']
" let g:syntastic_cpp_clang_tidy_post_args = ""
" autocmd FileType cpp if stridx(expand("%:p"), "/home/anaber/work/trenton/") == 0 |
" \ let g:syntastic_cpp_clang_tidy_args = "-p /home/anaber/work/trenton" | endif
" vim-airline
let g:airline#extensions#whitespace#enabled = 0
if !exists('g:airline_symbols')
let g:airline_symbols = {}
endif
let g:airline_symbols.colnr = ''
let g:airline#extensions#taglist#enabled = 1