vim

Vim show line numbers when using Explore


In VIM, I use :Explore or :Te to explore and open a new file. It gets a little tedious to scroll up and down using only J, K, Ctrl-D and Ctrl-U.

Is there a way to automatically show line numbers when using :Explore or :Te? This way I can go directly to the line I want with 32G if, for example, the line number is 32.

I have set number stored in my .vimrc, but this does not seem to apply to the file exporer.


Solution

  • Put this in your .vimrc:

    let g:netrw_bufsettings = 'noma nomod nu nowrap ro nobl'
    

    The settings beside 'nu' are the default settings, I'm not sure if you can enable just nu without overriding the rest.

    See also :help netrw.