Skip to main content
replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link

I run the following vim command to change the colour of highlighted columns to something more palatable than the default red:

:highlight ColorColumn ctermbg=235 guibg=#2c2d27

rather than run this manually everytime I start vim, I'd like to automate this. But how? I've tried adding the following to .vimrc:

highlight ColorColumn ctermbg=235 guibg=#2c2d27

But that has no effect (no errors, it's just ignored after restart). Am I doing something wrong? I got the command from this Q:

http://stackoverflow.com/questions/2447109/showing-a-different-background-colour-in-vim-past-80-charactershttps://stackoverflow.com/questions/2447109/showing-a-different-background-colour-in-vim-past-80-characters

But it didn't seem to shed light on my particular problem.

I run the following vim command to change the colour of highlighted columns to something more palatable than the default red:

:highlight ColorColumn ctermbg=235 guibg=#2c2d27

rather than run this manually everytime I start vim, I'd like to automate this. But how? I've tried adding the following to .vimrc:

highlight ColorColumn ctermbg=235 guibg=#2c2d27

But that has no effect (no errors, it's just ignored after restart). Am I doing something wrong? I got the command from this Q:

http://stackoverflow.com/questions/2447109/showing-a-different-background-colour-in-vim-past-80-characters

But it didn't seem to shed light on my particular problem.

I run the following vim command to change the colour of highlighted columns to something more palatable than the default red:

:highlight ColorColumn ctermbg=235 guibg=#2c2d27

rather than run this manually everytime I start vim, I'd like to automate this. But how? I've tried adding the following to .vimrc:

highlight ColorColumn ctermbg=235 guibg=#2c2d27

But that has no effect (no errors, it's just ignored after restart). Am I doing something wrong? I got the command from this Q:

https://stackoverflow.com/questions/2447109/showing-a-different-background-colour-in-vim-past-80-characters

But it didn't seem to shed light on my particular problem.

added 203 characters in body
Source Link
quant
  • 4.3k
  • 10
  • 39
  • 52

I run the following vim command to change the colour of highlighted columns to something more palatable than the default red:

:highlight ColorColumn ctermbg=235 guibg=#2c2d27

rather than run this manually everytime I start vim, I'd like to automate this. But how? I've tried adding the following to .vimrc:

highlight ColorColumn ctermbg=235 guibg=#2c2d27

But that has no effect (no errors, it's just ignored after restart). Am I doing something wrong? I got the command from this Q:

http://stackoverflow.com/questions/2447109/showing-a-different-background-colour-in-vim-past-80-characters

But it didn't seem to shed light on my particular problem.

I run the following vim command to change the colour of highlighted columns to something more palatable than the default red:

:highlight ColorColumn ctermbg=235 guibg=#2c2d27

rather than run this manually everytime I start vim, I'd like to automate this. But how? I've tried adding the following to .vimrc:

highlight ColorColumn ctermbg=235 guibg=#2c2d27

But that has no effect (no errors, it's just ignored after restart). Am I doing something wrong?

I run the following vim command to change the colour of highlighted columns to something more palatable than the default red:

:highlight ColorColumn ctermbg=235 guibg=#2c2d27

rather than run this manually everytime I start vim, I'd like to automate this. But how? I've tried adding the following to .vimrc:

highlight ColorColumn ctermbg=235 guibg=#2c2d27

But that has no effect (no errors, it's just ignored after restart). Am I doing something wrong? I got the command from this Q:

http://stackoverflow.com/questions/2447109/showing-a-different-background-colour-in-vim-past-80-characters

But it didn't seem to shed light on my particular problem.

Source Link
quant
  • 4.3k
  • 10
  • 39
  • 52

How do I make a vim command run automatically with .vimrc?

I run the following vim command to change the colour of highlighted columns to something more palatable than the default red:

:highlight ColorColumn ctermbg=235 guibg=#2c2d27

rather than run this manually everytime I start vim, I'd like to automate this. But how? I've tried adding the following to .vimrc:

highlight ColorColumn ctermbg=235 guibg=#2c2d27

But that has no effect (no errors, it's just ignored after restart). Am I doing something wrong?