Opens nerdtree to the root of your current project if not looking at a file
This commit is contained in:
@@ -75,7 +75,15 @@ imap <C-a> <esc>wa
|
|||||||
|
|
||||||
" ==== NERD tree
|
" ==== NERD tree
|
||||||
" Open the project tree and expose current file in the nerdtree with Ctrl-\
|
" Open the project tree and expose current file in the nerdtree with Ctrl-\
|
||||||
nnoremap <silent> <C-\> :NERDTreeFind<CR>:vertical<CR>
|
" " calls NERDTreeFind iff NERDTree is active, current window contains a modifiable file, and we're not in vimdiff
|
||||||
|
function! OpenNerdTree()
|
||||||
|
if &modifiable && strlen(expand('%')) > 0 && !&diff
|
||||||
|
NERDTreeFind
|
||||||
|
else
|
||||||
|
NERDTreeToggle
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
nnoremap <silent> <C-\> :call OpenNerdTree()<CR>
|
||||||
|
|
||||||
" ,q to toggle quickfix window (where you have stuff like Ag)
|
" ,q to toggle quickfix window (where you have stuff like Ag)
|
||||||
" ,oq to open it back up (rare)
|
" ,oq to open it back up (rare)
|
||||||
|
|||||||
Reference in New Issue
Block a user