[vim/vim] netrw tree view 'gn' mapping doesn't work properly (#2557)

24 views
Skip to first unread message

Suewon Bahng

unread,
Jan 15, 2018, 9:50:36 PM1/15/18
to vim/vim, Subscribed

Thank you, guys.

  • vim version : 8.0.1400_4
  • OS : Mac OS X 10.11.6 (15G1217)

When you use gn mapping after navigating subfolders a few times, you may get the following error message and it refuses to change the tree top.

    1 **error** (netrw) sorry, emmet-vim/ doesn't seem to be a directory!

Of course, emmet-vim/ is a valid directory!

The original mapping is as follows ( from $VIMRUNTIME/autoload/netrw.vim)

nnoremap <buffer> <silent> <nowait> gn	:<c-u>call netrw#SetTreetop(<SID>NetrwGetWord())<cr>

However, IMO, the right code should be something like so:

  let l:treetop = <SID>NetrwTreeDir(1)
  call netrw#SetTreetop(l:treetop)

I have changed gn mapping with this one, it's working fine.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub

Leeren

unread,
May 4, 2018, 12:58:40 AM5/4/18
to vim/vim, Subscribed

Any chance you could provide your new mapping to make this work? I tried something like what you posted but can't get it working.

Suewon Bahng

unread,
May 4, 2018, 3:56:36 AM5/4/18
to vim/vim, Subscribed

vim-netrwx.zip

@leeren

I've uploaded my plugin code for you. It contains the new gn mapping. Just install it as a regular plugin in your .vim folder.

DISCLAIMER I admit that the plugin code has been abandoned. It used to work when I developed it, but I can't guarantee anything for now. But you can cherry-pick only what you need from the code.

My plan was releasing it as an official project for fixing some existing Netrw bugs and augmenting some features (especially tree view features) that Netrw doesn't provide, but I gave it all up.

After some code reviewing and seeing some tree view bugs not taken care for such a long time, I realized that Netrw developers don't give a damn about tree view. So I switched to Nerdtree and abandoned the plugin code.

Leeren

unread,
May 6, 2018, 2:48:25 AM5/6/18
to vim/vim, Subscribed

@suewonjp

Thanks a lot! Yeah, I totally understand. I've really been trying to incorporate netrw as a lightweight means of project-tree based navigation, but there is just not enough demand for support in this feature anymore. I'll probably end up going the Nerdtree route too.

Reply all
Reply to author
Forward
0 new messages