22
6
My workspace is normally one very big xterm with vim, split into six or more buffers. It would be really helpful if it were more obvious which one was the active buffer. Right now I'm using the presence of line numbers for this:
augroup BgHighlight
autocmd!
autocmd WinEnter * set number
autocmd WinLeave * set nonumber
augroup END
but this means that when I change buffers my code jumps left or right, which is annoying. Plus, I'd like to be able to see which is line 94 even in an inactive buffer. So is there any way of changing the colours of the line numbers in the active buffer?
Using
hi StatusLine...
andhi StatusLineNC...
works like a charm! – Luc M – 2019-09-05T14:36:15.750I'd already tried changing the LineNr highlighting on WinEnter/WinLeave, but it appears that LineNr colouring is global. – DrHyde – 2012-02-03T14:58:02.943
Yes, and I had to wait your comment to remember that. So, no, if LineNr is global there is obviously no way to change it in a specific window. Don't you think the statusline is enough? – romainl – 2012-02-03T15:48:46.963
I wondered if there might be some other per-window version of LineNr. And no, I don't think the status line is enough. It helps, but I'd like more. One problem with using the status line is that having the active window indicator at the bottom of the window is the exact opposite of what we have just about everywhere else - a title bar at the top of a window that changes colour - so there's a moment's pause to think "oh yeah, vim does this the other way round". Whereas line numbers are always, in every application, in the same place. – DrHyde – 2012-02-03T22:22:07.477
I'd really like it if you could change window background color, but it sounds like, from the above, this isn't possible. – Jonathan Hartley – 2013-11-01T14:23:33.247