-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gvimrc
33 lines (23 loc) · 946 Bytes
/
.gvimrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
set guifont=Monaco:h16
" show line numbers
set nu
" use the mac meta key
set macmeta
augroup NERD
autocmd!
autocmd VimEnter * call s:CheckToOpenNERDTree()
autocmd VimEnter * wincmd l
augroup END
function! s:CheckToOpenNERDTree() abort
"dont open a tree for diff
if &diff | return | endif
"dont open a tree for gitcommits
if &ft == 'gitcommit' | return | endif
NERDTree
endfunction
" If another buffer tries to replace NERDTree, put it in the other window, and bring back NERDTree.
autocmd BufEnter * if bufname('#') =~ 'NERD_tree_\d\+' && bufname('%') !~ 'NERD_tree_\d\+' && winnr('$') > 1 |
\ let buf=bufnr() | buffer# | execute "normal! \<C-W>w" | execute 'buffer'.buf | endif
" Exit Vim if NERDTree is the only window remaining in the only tab.
autocmd BufEnter * if tabpagenr('$') == 1 && winnr('$') == 1 && exists('b:NERDTree') && b:NERDTree.isTabTree() | quit | endif
let NERDTreeIgnore = ['\.pyc$']