.vimrc file not working

I have the following short and simple .vimrc file that I’ve started as I begin to learn and write my own .vimrc:

  1 set number
  3 highlight GoComment xtermfg=blue
  5 syntax on

However, when I try to source it, I get the following:

Error detected while processing /home/matt/.vimrc:
line    3:
E423: Illegal argument: xtermfg=blue
Press ENTER or type command to continue

as well as:

Command 'highlight' not found, but can be installed with:
sudo apt install highlight
syntax: command not found

does anyone know what I’m doing wrong? Bear with me, I haven’t made my own .vimrc file before

Asked By: Mathew


Line 3 of your .vimrc file should probably be:

highlight GoComment ctermfg=blue

You can only choose between term (normal terminal), cterm (color terminal, including xterm) and gui.

As for your last screen dump (« Command ‘highlight’ not found … »), it makes no sense in a vim context. It appears you tried to execute your vimrc file as if it was a shell script.

Answered By: xhienne
Categories: Answers Tags:
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.