Vim’s relativenumber setting and multiple buffers

vim

I like the relative number setting. I'm refactoring code at the moment (translation: explodicating 5 year old terrible methods and replacing them with nice code) and I find it useful to have the setting active on files as I open them

I frequently either open multiple buffers or use a client/server vim to contain all my open buffers/files and have noticed that the relative number only seems to apply to the first buffer (and not the remaining buffers when I have set rnu in my .vimrc file.)

Is it expected behaviour for rnu to only initially apply to the first buffer until you manually set it?

Best Answer

Yes, it is expected behavior, unless you explicitly set it globally with ":setglobal":

:setglobal relativenumber

See ":help :setglobal" and ":help 'relativenumber'" (with the single quotes as part of the command).

Related Question