- Is it still necessary to attribute MIT code if it has been modified?
- Using OSS of different licenses in MIT licensed OSS software
- Will I be liable for injuries to someone else resulting from defending myself in a confrontation?
- Нужна ли здесь запятая в этом предложении?
- Вопрос о слове “ночью”
- Четвертная доля [о собственности] — грамотно ли так говорить?
- Сравнительный оборот, нужна ли запятая?
- Getting someone help who doesn’t want it
- How to anchor matchlist after searchpos?
- gretl Econometrics problem
- How to calculate the beta-factor in the Arbitrage Pricing Theory?
- How can I apply faces interactively under `font-lock-mode`?
- How can I get a list of all of the line numbers of headers / subtrees in an Org-mode file?
- Prevent emacs from saving previous versions of text files
- How can I prove the world is not a desert?
- Two planets in a stable horseshoe orbit?
- how large would a Yacht need to be in order to support a crew
- What are the realistic problems of a planet orbiting too close to its sun?
- How are logical fallacies identified in Hindu philosophical debates? Do they have specific names?
- Please describe the meaning of the Parashurama Yantra
Automatically change interface colors for normal(visual) vs input mode
I have found a related question here:
Automatically set the 'number' option in Vim when entering Ex mode, set 'nonumber' in visual mode
Still I am not sure that I can follow those explanations to achieve what I want.
So here is what I want to achieve:
For normal (and visual) mode, I've set up a color bar, for example here
I [ab]use the foldcolumn to indicate that I am in visual mode (see on the left a blue vertical bar):
Now if I go into insert mode I want it to change the color (now the bar is gray as if it is gone):
I want this to set up a strong visual feedback which helps
to always see in which mode I am currently.
Sometimes I start to input text when I am in normal or visual
mode and this results in running a lot of Vim's commands.
So how can I make that the color changes automatically in run-time when switching from insert to normal mode and back?
Here I use is foldcolumn, but it can be something else with similar effect to this.
VIM 7.4, Windo
Use the InsertEnter and InsertLeave autocmd events. For example, say I [ab]used the cursorline setting instead of the foldcolumn:
autocmd InsertEnter * set cursorline
autocmd InsertLeave * set nocursorline
So whatever it is you do to change the colour of the foldcolumn (hi FoldColumn ctermbg=blue?), put those as the commands after the autocmd InsertEnter * and autocmd InsertLeave *.
This is easier for the insert mode than other modes, since there are autocmd events for entering and leaving insert mode, but not for normal, visual, etc.2017-04-07 04:53:49