Skip to content

Instantly share code, notes, and snippets.

@iMerica
Created May 18, 2013 18:54
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 iMerica/5605423 to your computer and use it in GitHub Desktop.
Save iMerica/5605423 to your computer and use it in GitHub Desktop.
Michael's VimRC
filetype off
call pathogen#incubate()
call pathogen#helptags()
filetype plugin indent on
set runtimepath^=~/.vim/bundle/ctrlp.vim
syntax enable
set background=light
autocmd VimEnter * NERDTree
set smartindent
set nohlsearch
set showmode
set hlsearch
set incsearch
set tabstop=4
set autoindent
set number
set ignorecase
set history=1000
set undolevels=1000
set visualbell
set noerrorbells
"folding settings
set foldmethod=syntax "fold based on indent
set foldlevelstart=1
set foldnestmax=10 "deepest fold is 10 levels
set foldlevel=1 "this is just what i use
filetype plugin on
function! NERDTreeQuit()
redir => buffersoutput
silent buffers
redir END
" 1BufNo 2Mods. 3File 4LineNo
let pattern = '^\s*\(\d\+\)\(.....\) "\(.*\)"\s\+line \(\d\+\)$'
let windowfound = 0
for bline in split(buffersoutput, "\n")
let m = matchlist(bline, pattern)
if (len(m) > 0)
if (m[2] =~ '..a..')
let windowfound = 1
endif
endif
endfor
if (!windowfound)
quitall
endif
endfunction
autocmd WinEnter * call NERDTreeQuit()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment