I tend to use vim . to explore my directories.

However, settings from ~/.vimrc only seem to take effect for vim FILENAME rather than vim DIR.

For example, i have set rnu in my ~/.vimrc file, but when i use vim . i do not see the relative line numbers. On the other hand, vim FILE will show the relative line numbers.

Does anyone know how i can configure settings to apply to the Vim Explorer as well?

1 Answer 1


There's no such thing as "Vim Explorer". You're probably using netrw-plugin (which also provides :Explore command).

If that's the case you can setup your options with :h g:netrw_bufsettings. For instance,

let g:netrw_bufsettings = 'noma nomod nobl nowrap ro nonu rnu'

Anyway, if some option "does not work" for specific window or buffer, that's because that window or buffer has its own local value of that option which happens to be different from the global default one.

  • I think you can also use the filetype mechanism for netrw
    – D. Ben Knoble
    May 18, 2020 at 14:47
  • @D.BenKnoble Netrw can reset local settings. A horrible thing, IMO.
    – Matt
    May 18, 2020 at 15:33

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.