Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
91 lines (75 sloc) 1.87 KB
color vwilight
set guifont=Menlo\ For\ Powerline:h14
set linespace=2
set antialias
" Don't beep
set visualbell
" Start without the toolbar and disable scrollbars
set guioptions-=T
set guioptions-=rL
if exists("loaded_nerd_tree")
augroup AuNERDTreeCmd
autocmd AuNERDTreeCmd VimEnter * call s:CdIfDirectory(expand("<amatch>"))
autocmd AuNERDTreeCmd FocusGained * call s:UpdateNERDTree()
autocmd AuNERDTreeCmd WinEnter * call s:CloseIfOnlyNerdTreeLeft()
endif
" Close all open buffers on entering a window if the only
" buffer that's left is the NERDTree buffer
function s:CloseIfOnlyNerdTreeLeft()
if exists("t:NERDTreeBufName")
if bufwinnr(t:NERDTreeBufName) != -1
if winnr("$") == 1
q
endif
endif
endif
endfunction
" If the parameter is a directory, cd into it
function s:CdIfDirectory(directory)
let explicitDirectory = isdirectory(a:directory)
let directory = explicitDirectory || empty(a:directory)
if explicitDirectory
exe "cd " . fnameescape(a:directory)
endif
" Allows reading from stdin
" ex: git diff | mvim -R -
if strlen(a:directory) == 0
return
endif
if directory
NERDTree
wincmd p
bd
endif
if explicitDirectory
wincmd p
endif
endfunction
" NERDTree utility function
function s:UpdateNERDTree(...)
let stay = 0
if(exists("a:1"))
let stay = a:1
end
if exists("t:NERDTreeBufName")
let nr = bufwinnr(t:NERDTreeBufName)
if nr != -1
exe nr . "wincmd w"
exe substitute(mapcheck("R"), "<CR>", "", "")
if !stay
wincmd p
end
endif
endif
if exists(":CommandTFlush") == 2
CommandTFlush
endif
endfunction
if has("gui_macvim")
" Fullscreen takes up entire screen
set fuoptions=maxhorz,maxvert
macmenu &File.New\ Tab key=<D-T>
map <D-t> :CommandTFlush<cr>\|:CommandT<cr>
map <D-/> <Plug>CommentaryLine
vmap <D-/> <Plug>Commentary
end