Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How do I modify my custom colorscheme to make splits which do have the cursor change to a different color (I want to change the splits other than the one I am currently editing to be a muted gray rather than the same color as the split I am currently editing).

share|improve this question
I've got only one cursor, in the current window. – romainl Oct 24 '12 at 8:11
This isn't really possible, since Vim doesn't let you change the background color or the default text color on a per-window or per-buffer basis. – Heptite Oct 24 '12 at 19:07

Vim uses the Normal highlight group for all window backgrounds. The only distinction for active vs. other windows is the StatusLine vs. StatusLineNC highlighting of the status line (i.e. the line below each window that separates the splits). That's all that Vim offers.

With a distinctive cursor, that should be enough to easily recognize the active window. Also, fading other windows is often counter-productive, because that makes it harder to refer to text displayed in them.

share|improve this answer

After a bit of research, it seems that my original question isn't really possible. However, this solution comes close enough for my purposes:

autocmd WinEnter * setlocal cursorline
autocmd BufEnter * setlocal cursorline
autocmd WinLeave * setlocal nocursorline
setlocal cursorline

Essentially what this does is highlight the line the cursor is on in a nice way. Consequently a quick glance at the screen tells me exactly where the cursor is, and which window the cursor is in. Combined with the idea of a nice colors for StatusLine and StatusLineNC and it is quite workable.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .