0

I have a default colour scheme on Vim which loads every time I open Vim. I would like to load a different colour scheme in some cases, by doing something like

vim -custom

when launching vim from iTerm. Is this possible?

Elise
  • 5,086
  • 4
  • 36
  • 51

1 Answers1

2

You can pass a command to vim via option --cmd <command> or -c <command> or +<command>:

$ vim --help
...
+<lnum>             Start at line <lnum>
--cmd <command>     Execute <command> before loading any vimrc file
-c <command>        Execute <command> after loading the first file
...

These commands will set colorscheme to darkblue:

vim -c 'color darkblue'
vim --cmd 'color darkblue'
vim +'color darkblue'
kev
  • 155,172
  • 47
  • 273
  • 272
  • As the colorscheme is usually set in `.vimrc`, the `--cmd` one will be overridden by that. (But the others do work.) – Ingo Karkat Sep 27 '14 at 18:09