.vimrc 파일이 작동하지 않습니다

.vimrc 파일이 작동하지 않습니다

나만의 .vimrc를 배우고 작성하기 시작하면서 다음과 같은 짧은 .vimrc 파일을 사용하기 시작했습니다.

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

그러나 그것을 얻으려고 하면 다음과 같은 결과가 나옵니다.

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

또한:

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

내가 뭘 잘못하고 있는지 아는 사람 있나요? 양해해 주시기 바랍니다. 저는 이전에 .vimrc 파일을 직접 만든 적이 없습니다.

답변1

.vimrc파일의 3번째 줄아마도 그래야 할 것이다:

highlight GoComment ctermfg=blue

당신은 선택할 수 있습니다term(일반 터미널), cterm(xterm을 포함한 컬러 터미널) 및 gui.

마지막 화면 덤프("'highlight' 명령을 찾을 수 없습니다...")는 vim 컨텍스트에서는 의미가 없습니다. vimrc 파일을 쉘 스크립트처럼 실행하려는 것 같습니다.

관련 정보