I want to customize vimrc to change background color to yellow when switched to
"Insert mode". It should be easy but I can not find how to do it. Any help will
be appreciated.
regards,
:au InsertEnter * hi Normal term=reverse ctermbg=darkgrey guibg=yellow
:au InsertLeave * hi Normal term=NONE ctermbg=black guibg=white
Change to taste.
see
:help InsertEnter
:help InsertLeave
:help :autocmd
:help :highlight
Best regards,
Tony.
--
ARTHUR: Go on, Bors, chop its head off.
BORS: Right. Silly little bleeder. One rabbit stew coming up.
"Monty Python and the Holy Grail" PYTHON (MONTY)
PICTURES LTD
Thanks, I settled for lightcyan.
regards,
The Dos/Windows console Vim can use a limited set of 'guicursor'
settings (it can change the height, but not the width, of its cursor).
For other terminals, you have to find out which control codes (if any)
can be used to change the cursor shape and/or the cursor colour, and set
them as the values of 't_SI' (start insert) and 't_EI' (end insert).
These codes are not defined by the termcap/terminfo databases (their
default value is always the empty string), you have to set them
yourself. See ":help termcap-cursor-shape" for details.
Best regards,
Tony.
--
We ARE as gods and might as well get good at it.
-- Whole Earth Catalog
I think that guicursor is available on my gvim. However I can not always notice
the big bold "INSERT" word in the status line, not to mention that small change
in cursor.
regards,
Yes, 'guicursor' is available in all versions of gvim when run in GUI
mode (the paragraph from John's post was about Console mode). I use a
big black block cursor in Normal mode, a vertical bar in Insert mode, a
horizontal underscore in Replace mode, and I make it blink at the rate
of .75 seconds on, .75 seconds off in all modes (i.e., at a frequency of
1.5 Hz). I don't have any problem noticing it. Here's my whole setting:
:set
gcr=n-v-c:block-Cursor/lCursor,ve:ver35-Cursor,o:hor50-Cursor,i-ci:ver25-Cursor/lCursor,r-cr:hor20-Cursor/lCursor,sm:block-Cursor,a:blinkwait750-blinkoff750-blinkon750
:hi Cursor gui=NONE,reverse
Best regards,
Tony.
--
Hail to the sun god
He sure is a fun god
Ra! Ra! Ra!
Just a thought (and I don't use this) but if you have been having
problems with forgetting that you are in insert mode, this tip might
be useful:
http://vim.wikia.com/wiki/To_switch_back_to_normal_mode_automatically_after_inaction