tags:

views:

385

answers:

3

When I put the following in .vimrc

colorscheme blue

It gives me a nice blue colorscheme in gvim. However, when I use vim, it is light blue instead. Is there a setting I can change so that gvim and vim look the same? If not, then is there a way I can set it up so that my gvim settings do not interfere with my vim settings?

+1  A: 

set your vim settings in the .vimrc file, and set the gvim settings in the .gvimrc settings file.

Just pick a different colorscheme in the .gvimrc...

John Weldon
Ok, that works. I don't understand why in the gvim menu for editing startup settings it goes to the .vimrc file and not the .gvimrc file.
Phenom
Because most of your startup settings will be in .vimrc. Only GUI specific settings belong in .gvimrc.
Ton van den Heuvel
+5  A: 

As well as John's suggestion of using .gvimrc, there are a couple of other interesting alternatives:

If your command-line vim is compiled with +gui (:echo has("gui"))* and you have a 256 colour capable terminal, you can use the CSApprox plugin to convert the GUI colour scheme into a matching command line one.

If your command-line vim doesn't have +gui, you could try (I haven't used this one) the guicolorscheme plugin. The guicolorscheme plugin parses the colour scheme file, so it isn't as robust as the CSApprox one (it almost certainly won't work with my colour scheme for example.

There's a lot more information on both of those methods here and here.


* Regarding has("gui"):

If you're not interested in +gui, stop reading now!

Personally, I'd recommend this as it simplifies things a bit - you get the opportunity to type :gui if you want to change from terminal to GUI and as you inevitably have +X11 and +xterm_clipboard as well, you can copy to the X clipboards from console vim. If your vim doesn't have +gui, the easiest way to fix it is to create a link in your personal bin directory to the GUI executable:

ln `which gvim` ~/bin/vim

GVim will quite happily work as a console vim if the executable name is vim. A "default" build from the vim source with GUI enabled will create one executable (vim) and lots of links to that executable like gvim, gview, view, vimdiff etc. Most Linux distributions seem to compile them separately though, in order to minimise requirements of the basic Vim (so you can use vim without installing X). As such, I tend to recompile and install in /usr/local with the features I want as I always have X installed (it doesn't have to be running, just installed).

Al
Interesting +! :)
John Weldon
+1  A: 

If you are using a modern terminal which support 88 or 256 colors(most of them do like gnome-terminal or roxterm(on linux) not sure about Mac or Vim) , you should check out this vim script CSApprox(http://www.vim.org/scripts/script.php?script_id=2390). This scripts make the color schemes made for gvim, work with terminal vim.

mirnazim