" For git mergetool " :diffg RE " get from REMOTE " :diffg BA " get from BASE " :diffg LO " get from LOCAL execute pathogen#infect() syntax on filetype plugin indent on set exrc set secure set title function InitBase() set tabstop=4 set softtabstop=4 set shiftwidth=4 set noexpandtab set number set hidden set undofile set undodir=~/.cache/vim-undo// set colorcolumn=82 set textwidth=82 highlight ColorColumn ctermbg=darkgray set hlsearch set foldmethod=syntax execute 'GitGutterEnable' endfunction " Write as root cmap w!! w !sudo tee >/dev/null % cabbrev E Explore nnoremap :Explore nnoremap l :bnext nnoremap h :bprev nnoremap :buffers:buffer let g:netrw_banner=0 let g:netrw_liststyle=1 let g:netrw_list_hide='\(^\|\s\s\)\zs\.\S\+' let g:table_mode_corner="|" colorscheme elflord " Directory where *.swp files will be stored set directory=$HOME/.cache/vim// map :call InitBase() map :setlocal spell! spelllang=en_us function InitBash() call InitBase() " Format current file with indent map gg=G2 map :w map :wa endfunction function InitPython() call InitBase() set colorcolumn=79 set textwidth=79 unmap map :w map :wa nmap :TagbarOpen fc "execute 'NERDTree' endfunction function InitC() call InitBase() map gggqG2 map :w map :wa map :w:make map :cp map :cn map :cl nmap :TagbarOpen fc autocmd BufNewFile,BufRead *.c set formatprg=indent\ -kr\ -cp1\ -cd1\ -ts4\ -nut\ -brf autocmd BufNewFile,BufRead *.cpp set formatprg=indent\ -kr\ -cp1\ -cd1\ -ts4\ -nut\ -brf autocmd BufNewFile,BufRead *.h set formatprg=indent\ -kr\ -cp0\ -cd1\ -ts4\ -nut\ -brf autocmd BufNewFile,BufRead *.hpp set formatprg=indent\ -kr\ -cp1\ -cd1\ -ts4\ -nut\ -brf execute ':silent !ctags -R -f .tags' autocmd VimLeave * !rm .tags execute ':silent !cscope -Rbq -f .cscope.out' execute 'cscope add .cscope.out' autocmd VimLeave * !rm .cscope* " cscope maping nmap s :cs find s =expand("") nmap g :cs find g =expand("") nmap c :cs find c =expand("") nmap t :cs find t =expand("") nmap e :cs find e =expand("") nmap f :cs find f =expand("") nmap i :cs find i ^=expand("")$ nmap d :cs find d =expand("") nmap s :vert scs find s =expand("") nmap g :vert scs find g =expand("") nmap c :vert scs find c =expand("") nmap t :vert scs find t =expand("") nmap e :vert scs find e =expand("") nmap f :vert scs find f =expand("") nmap i :vert scs find i ^=expand("")$ nmap d :vert scs find d =expand("") execute ':redraw' endfunction let g:ycm_path_to_python_interpreter="/usr/bin/python3" let g:ycm_global_ycm_extra_conf = "~/.ycm_c_conf.py"