Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

I'm trying to create a script to make the vi color change described here

Trying to do it with sed but it's not working for some reason

I do this, but nothing happens..

sudo sed -i 's/^hi Comment      ctermfg=darkcyan$/hi Comment      ctermfg=blue/' desert.vim

I can't figure out what I'm doing wrong, any ideas?

share|improve this question
Are you sure it's not a tab character in the file? That you have the same number of spaces? Did you try it with a copy of the file you own so you don't need sudo? – Daniel Beck May 30 '13 at 11:16
This answer should probably be in since it is directly related with scripting/programming. – HelpingHand May 30 '13 at 13:38
ahhh that's it! it's a tab.. doh! Thanks Daniel – Oscar Jun 2 '13 at 4:32

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.