In my .vimrc file located in my home directory, I have already added set nu and every time I open a file in gvim, I get line numbers displayed at the extreme left.
But whenever I open a folder in gvim using :Vex (vertical split and open explorer) or :Te(open a new tab with explorer) commands or for that matter open a directory using gvim, I don't see line numbers, in spite of having set nu in my .vimrc and I have to again do :set nu manually.
I am using cent os 7 and netrw 149 and vim 7.4
How to get line numbers always whenever I open explorer using netrw in gvim?
Assuming your vim directory is
~/.vim, You could try addingin ~/.vim/after/ftplugin/netrw.vim
ftpluginfiles are loaded every time a buffer is opened with the corresponding filetype. In this case the filetype isnetrwso the file is callednetrw.vim. You can check the file type of any buffer with:echo &filetype.