4

as we know that we can use Vim to browse a directory. My question is what does number + Enter do on a file list?
I thought it equivalent to number + j + Enter, however, after I enter into a file, using :b# leads me to another "unpredictable" location.

Eg, suppose we have /A/B/f1 /A/B/f2 /A/B/f3 /A/C/f4 /A/C/f5.

When I enter into folder A from Vim and the cursor is on ../, what will happen if I type 2 + Enter or 3 + Enter? When a file is open, what will happen when I type :b# in this case?

Thanks!

1
  • :help netrw-cr does not document any use of the count. Most attempts I have made result in Invalid range: call s:UseBufWinVars()
    – Random832
    Commented Mar 17, 2015 at 17:22

1 Answer 1

4

The Enter binding of netrw is documented in the netrw-cr help section. It mentions nothing about any use of the count.

I suspect the count is simply "falling through" to an internal function of netrw that is not prepared to handle it. Most of my own attempts resulted in the error message Invalid range: call s:UseBufWinVars(), and those that didn't did not form any recognizable pattern, though I did notice ending up in directories that were multiple steps away from the one that I had been browsing.

Calling it with a very large count like 100 results in many instances of the same error message, suggesting something is being executed a number of times corresponding to the count.

2
  • Thanks, but what does "netrw-cr" mean? And what does "netrw" stand for? Commented Mar 17, 2015 at 19:00
  • 1
    netrw is the plugin that handles directory browsing with Explore, its help topics have a prefix of netrw-, and cr refers to the carriage return key (enter). It's called netrw because it also handles reading and writing files over a network.
    – Random832
    Commented Mar 17, 2015 at 19:01

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.