I want to use solarize for macvim, but I want the default for when I am in vi. I assume I put a dew lines of code in my .vimrc... but what do I put in there?
MacVim uses the ~/.gvimrc, so you could set it up in the ~/.gvimrc file. Or you could use has("gui_running"):
if has("gui_running")
colorscheme solarized
endif
Both versions should work.
You can also use
if has("gui_macvim")
colorscheme solarized
endif
If you want solarized only for MacVim but not other graphical vim clients.
Related
I have used vim for a while now, but after my friend introduced me to gvim, I'm trying to use it now. I have basic vimrc settings of :
set guifont=Monaco:h17
colorscheme zellner
set number
syntax on
I noticed that the settings were applied to my gvim. I want a different colorscheme for gvim and vim as I usually open the files I'll read quickly with vim or vi, and use gvim as my main code editor.
I heard people talk about the .gvimrc file, but I don't have it where my .bashrc, .zshrc, and .vimrc are.
How do I have separate colorschemes for gvim and vim?
Vim doesn't create either ~/.vimrc or ~/.gvimrc for you so you have to create them on your own.
You can either create the missing file in your shell, then edit in Vim:
$ touch ~/.gvimrc
$ vim ~/.gvimrc
<some editing>
:wq
or do everything from Vim:
:e ~/.gvimrc
<some editing>
:wq
Note: ~/.vimrc is still sourced whether you have a ~/.gvimrc or not so your gvimrc can be kept lightweight by only having GUI-specific options and overrides. In your case:
" ~/.vimrc
colorscheme zellner
set number
syntax on
" ~/.gvimrc
set guifont=Monaco:h17
colorscheme slate
You can do it in a single ~/.vimrc:
if has("gui_running")
colorscheme zellner
else
colorscheme blue
endif
See http://vimdoc.sourceforge.net/htmldoc/eval.html#has() and http://vimdoc.sourceforge.net/htmldoc/eval.html#feature-list
I'm wondering why my VIM can't apply the changes I modify in $MYVIMRC. The changes only apply to GVIM instead of VIM. I have the following in $MYVIMRC:
syntax on
colorscheme tomorrow-night
I also tried changing the color scheme setting in the command bar below by typing :colorscheme tomorrow-night but nothing changed. Why is it not changing?
The main difference between Vim and GVim is that GVim is an independent application that does not run in your terminal emulator.
If you use Vim and GVim for different purposes, I recommend you to create also a gvimrc file. But if you want to keep a single vimrc file, you can do something like this:
if has('gui_running')
" GVim
set guifont=Larabiefont\ 13
else
" Vim
set t_Co=256
set termguicolors
endif
colorscheme archery
Notice the set termguicolors in this code. I think this is the most convenient solution nowadays for common issues with colorschemes. It tells Vim to use the true colors defined for GVim with hexadecimal notation in guifg and guibg (instead of ctermfg and ctermbg).
I'm trying to install Solarized colorschem for vim, unfortunately i have some background problem: screen & ~/.vimrc
i do all necessary ~/.vimrc settings:
let g:solarized_termcolors=256
set t_Co=256
set background=dark
colorscheme solarized
in vim :echo $TERM return xterm-256color
and :set t_Co? return t_Co=256
Also, i check my terminal(lxterminal) for 256color support by Colortest utility from vim.org and i got this rgb grid.
I don't find solution of my problem and have no idea what else i'm supposed to do, that's why i start new topic
You have to config your terminal with solarized theme too.
check http://ethanschoonover.com/solarized/vim-colors-solarized, and search keyword: please please pleaseyou are gonna see:
IMPORTANT NOTE FOR TERMINAL USERS:
If you are going to use Solarized in Terminal mode (i.e. not in a GUI
version like gvim or macvim), please please please consider setting
your terminal emulator’s colorscheme to used the Solarized palette.....
I use gui version of macvim for my general development activites.
I use mvim from terminal also as I've mapped mvim to vim alias.
How can I open different color scheme in mvim based on whether they are opened in gui version or terminal version?
I want to set solarized colorscheme for gui version of macvim and
grb256(or anyother) colorscheme in terminal version of mvim.
How can we do this ?
if has("gui_running")
colorscheme solarized
else
colorscheme grb256
endif
And you can set any other things in there you prefer. This is the full block from my .vimrc:
if has('gui_running')
let g:solarized_contrast = 'high'
set guifont=Mensch:h14
set antialias
set background=light
colorscheme solarized
else
set background=dark
colorscheme cobalt2
endif
I'am using vim in Konsole and Yakuake. But I can't see the correct colorscheme.
My .vimrc file have the following text:
t_Co=256
syntax enable
set background=dark
colorscheme desert
My OS is Debian Sid.
Can you help me?
you need csapprox plugin to correctly display some color schemes in terminal