Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.vimrc:2: command not found: colorscheme

I'm trying to change the color scheme on my vim editor.

I put this on the .vimrc file

set t_Co=256
colorscheme molokai

I have the molokai.vim file on .vim/colors

And when I try to load the .vimrc file with the source command (on Mac OS X) I get this error

.vimrc:2: command not found: colorscheme

Could you help me?

like image 510
navamario Avatar asked Dec 11 '22 03:12

navamario


2 Answers

It appears that you're "loading" the .vimrc file by trying to run it within a shell. Because that's the sort of message you'll get if you try to execute it, with something like:

./.vimrc

or:

source .vimrc

(most shells having a set command so they're unlikely to complain about that first line).

That's not how the .vimrc file is processed, vim itself will process the file as it starts up.

All you need to do is edit the file (and save it of course) then, the next time you start a vim session, it will pick up the changes.

like image 59
paxdiablo Avatar answered Feb 02 '23 09:02

paxdiablo


The correct command for colorscheme is color molokai. Try that instead of colorscheme molokai.

like image 38
Weafs.py Avatar answered Feb 02 '23 10:02

Weafs.py