1

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
  2 
  3 highlight GoComment xtermfg=blue
  4 
  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

4
  • What do you mean "source it"? You just run vim, you don't source anything... if you source or . it, your shell will try to execute those statements.
    – Panki
    Commented Nov 3, 2023 at 22:34
  • I ran vim as well, I still get the errors
    – Mathew
    Commented Nov 3, 2023 at 23:31
  • 2
    What are you running? vim is never going to tell you to install something with apt to my knowledge.
    – Panki
    Commented Nov 3, 2023 at 23:35
  • Ubuntu 22.04, and I recently installed go and vim-go
    – Mathew
    Commented Nov 4, 2023 at 0:00

1 Answer 1

1

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.

1
  • the issue was I was using xtermfg instead of ctermfg, thanks!
    – Mathew
    Commented Nov 4, 2023 at 13:49

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .