Skip to content

Instantly share code, notes, and snippets.

@karl82
Created February 7, 2016 14:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save karl82/2469f5f0a785beb52b5b to your computer and use it in GitHub Desktop.
Save karl82/2469f5f0a785beb52b5b to your computer and use it in GitHub Desktop.
colorscheme darkblue
syntax on
set nocompatible
set backspace=indent,eol,start
set nu
set wmw=0
set wmh=0
set noea
set nowrap
" auto indent files
set autoindent
" expand tabs
set et
" step to use indent
set sw=4
"
set ts=4
set history=400
"set ruler
set showcmd
set cul
set ls=2
set statusline=%<%f\ %y%h%m%r
set statusline+=%{fugitive#statusline()}
set statusline+=%=%-14.(%l,%c%V%)\ %P
set hls
set noincsearch
filetype plugin indent on
set showmatch
set mat=6
" Opening and closing braces
imap <C-F> {<CR>}<C-O>O
set sessionoptions+=resize
set diffopt+=iwhite
set background=dark
filetype plugin on
" upload/edit vimrc
nmap <Leader>s :source $HOME/.vimrc
nmap <Leader>v :e $HOME/.vimrc
" format file using xmllint
map <F2> <Esc>:1,$!xmllint --format -<CR>
" look for ctags and cscope
let parent_dir = expand("%:p:h")."/"
while match(parent_dir,"/",0)>-1 && isdirectory(parent_dir)
let parent_tag = parent_dir."tags"
if filereadable(parent_tag)
exe ":set tags+=".parent_tag
endif
let parent_tag = parent_dir."cscope.out"
if filereadable(parent_tag)
exe ":cs add ".parent_tag
endif
let parent_dir = substitute(parent_dir,"[^/]*/$","","")
endwhile
let parent_dir = getcwd()."/"
while match(parent_dir,"/",0)>-1 && isdirectory(parent_dir)
let parent_tag = parent_dir."tags"
if filereadable(parent_tag)
exe ":set tags+=".parent_tag
endif
let parent_tag = parent_dir."cscope.out"
if filereadable(parent_tag)
exe ":cs add ".parent_tag
endif
let parent_dir = substitute(parent_dir,"[^/]*/$","","")
endwhile
unlet parent_dir parent_tag
" Your customised tags go first.
"set tags+=~/tags,$DOC/tags
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment