Skip to content

Instantly share code, notes, and snippets.

@jhsu
Last active December 10, 2015 21:59
Show Gist options
  • Save jhsu/4499080 to your computer and use it in GitHub Desktop.
Save jhsu/4499080 to your computer and use it in GitHub Desktop.
netrw + nerdtree to navigate files in buffer rather than in a drawer.

Inspired by vimcast article

Open file browser in curent buffer

This makes it more clear which split a file will be opened in.

Use rbgrouleff/bclose.vim to close the buffer and not break splits.

map <silent> bd :Bclose<CR>
 
" NERD_tree
" map <silent> <leader>d :execute 'NERDTreeToggle ' . getcwd()<CR>
map <silent> <leader>d :execute 'e '. getcwd()<CR>
 
let NERDTreeHijackNetrw=1

Now you can <leader>d to open nerdtree in the current buffer and use bd to close the buffer or simply open a file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment