2

When using netrw or the native vim file explorer, every time I click on ../, the cursor moves to the top of the page. This is very irritating when I'm trying to go up multiple directories - I have to scroll back down to the ../ and click again, only to have my cursor sent to the top of the buffer yet again.

Is there some way to prevent this?

I'm using Vim 7.4, with the following netrw specific setting:

let g:netrw_liststyle=3
4
  • 2
    I don't see this problem. I used: gvim /home/martin, and then tried both selecting ../ with the keyboard (Enter) and clicking on it with the mouse. I go up a directory, and in this new directory ../ is selected again. Perhaps the problem is something in your vimrc file? Try How do I debug my vimrc file?. Mar 26, 2015 at 15:47
  • That is intersting.. it even happens with vim -U NONE
    – user489
    Mar 26, 2015 at 15:59
  • Ah, I forgot to mention that I've enabled the file tree setting.. see the edited question
    – user489
    Mar 26, 2015 at 16:03
  • 1
    I can reproduce the problem when setting let g:netrw_liststyle=3 ;-) By the way: vim -U NONE prevents loading the gvimrc file, not the vimrc file. You need to use vim -u NONE ;-) Mar 26, 2015 at 16:07

1 Answer 1

2

This seems to be a bug in netrw. I looked at the code and tried to fix it, but after a few minutes I gave up. The code is not exactly readable...

I did notice that pressing Enter while on the first line makes the cursor jump to the ../ line; so pressing Enter twice works, this may be an acceptable work-around for you.

If not, I suggest contacting the netrw author as listed in :help pi_netrw.txt

PS.
I discovered what seems to be another bug, if I start Vim with vim /home/martin, then press jj<Enter to open the first directory, and go back up to ../, I need to select it twice before I go to the root directory.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.