Alternative to NERDTree in Vim [closed]
Asked Answered
V

1

9

I used to use NERDTree quite happily but found it causes problems when using the YouCompleteMe plugin (which is much more useful). In the mean time I have been using Ctrl-P which is a useful plugin in itself but I'm missing the overview of my projects that NERFTree gave me.

Can anyone suggest an alternative that does roughly the same thing and hopefully without the problems associated with NERDTree?

Vadnee answered 17/8, 2013 at 10:6 Comment(5)
Well, what's the actual problem you have?Coelenterate
I'm using NERDTree and YCM together without issue.Zackaryzacks
1. What are those problems with NERDTree/YCM? 3. Vim comes by default with netrw, did you even try it before installing NERDTree?Borosilicate
Sorry should have said. Whenever the autocmplete menu from YCM opened it would crash Vim and the only way to get out of it was to close Vim. As soon as a I ditched NERDTree the problem completely went away.Vadnee
github.com/Shougo/vimfiler.vimJsandye
C
19

If you're using a fuzzing plugin to open buffers most of the time, and use NERDTree only to explore larger directory hierarchies, you might want to learn about Vim's built-in netrw interface: :help netrw.

Options that I found particulary useful were:

let g:netrw_banner       = 0
let g:netrw_keepdir      = 0
let g:netrw_liststyle    = 1 " or 3
let g:netrw_sort_options = 'i'

And maybe a way to run it on Vim startup:

1) Open it at startup if no argument was specified ($ vim):

autocmd VimEnter * if !argc() | Explore | endif

2) Open it only when the specified argument is a directory ($ vim /tmp):

autocmd VimEnter * if isdirectory(expand('<afile>')) | Explore | endif

HTH

Coelenterate answered 17/8, 2013 at 10:29 Comment(6)
Thanks for the answer. It certainly looks like what I am after but I'm still a bit confused since I have never used it before. Is it possible to have the directory layout window in a separate buffer as was the case in NERDTree? I didn't notice any difference when adding the last like to my vimrc file. I've brioefly read through the help topic but it seems to concentrate on remote editing which I am not really bothered about. Do you know of any other places of onformation targeting more of what I am looking for?Vadnee
The big issue really is how to toggle back and forth between the netrw browse window.Vadnee
:help netrw-explorer describes the different ways to open the explorer. You probably want :Vexplore. Also see :help netrw-browse-maps for navigation info.Coelenterate
I'd vote you up a again if I could this is exactly what I was looking for. Thank you.Vadnee
You're welcome! From experience I can tell that there is an unusual high number of Vim users who never used (or even know about) netrw. So I'm glad to spread the word! :-)Coelenterate
If you are usign netrw, consider ranger as a replacementOriginative

© 2022 - 2024 — McMap. All rights reserved.