Created
May 18, 2013 18:54
-
-
Save iMerica/5605423 to your computer and use it in GitHub Desktop.
Michael's 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
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