Just how do I enable full-color assistance in Vim?
I have a wonderful Vim colorscheme (xoria256) and also it looks great in GVim, yet when I make use of regular
vim in Terminal, the colorscheme is just partly sustained-- as an example, the default semi-transparent aubergine history shade is made use of. Just how do I make Terminal consistently provide my Vim colorscheme?
Well, you can constantly set up Gvim to make it resemble Vim. You simply need to create a ~/. gvimrc documents and also paste in it these customisation methods :
set guioptions-=r " no scrollbar on the right set guioptions-=l " no scrollbar on the left set guioptions-=m " no menu set guioptions-=T " no toolbar
I do not assume this addresses your trouble, yet that recognizes ; -)
Just include the line listed below right into your
$HOME/.bashrc (ideally in the last line of the documents) :
And wait. After, reactivate your gnome - terminal. This adjustment will certainly be readily available not just in vim, but also for all your terminal applications.
To examine if it functions, run this little script :
#!/usr/bin/env python # Copyright (C) 2006 by Johannes Zellner, <[email protected]> # modified by [email protected] to fit my output needs # modified by [email protected] to fit my output needs import sys import os def echo(msg): os.system('echo -n "' + str(msg) + '"') def out(n): os.system("tput setab " + str(n) + "; echo -n " + ("\"% 4d\"" % n)) os.system("tput setab 0") # normal colors 1 - 16 os.system("tput setaf 16") for n in range(8): out(n) echo("\n") for n in range(8, 16): out(n) echo("\n") echo("\n") y=16 while y < 231: for z in range(0,6): out(y) y += 1 echo("\n") echo("\n") for n in range(232, 256): out(n) if n == 237 or n == 243 or n == 249: echo("\n") echo("\n") os.system("tput setaf 7") os.system("tput setab 0")
Thereafter, you will certainly see something like the following (relies on your gnome - terminal motif) :
GNOME Terminal sustains 256 colors, yet does not market its assistance. You can bypass vim's autodetection by placing the following:
if $COLORTERM == 'gnome-terminal' set t_Co=256 endif
in your ~/. vimrc.
Keep in mind : if you make use of GNU screen, it will gladly consume those 256 - shade codes and also transform them to standard 16 colors. A far better solution is to transform TERM to xterm - 256color prior to releasing screen/vim.
Update for 2017 : if you have a completely current Vim (7.4.1799 or more recent), and also a completely innovative incurable emulator (xterm, or gnome - incurable based upon a completely current variation of VTE), you can
:set termguicolors and also incurable vim will certainly make use of complete 24 - little bit colors as specified by your vim motif making use of
highlight guifg=#rrggbb guibg=#rrggbb.
An extra basic remedy is to install the term type "xterm - 256color". In 10.04 I assume it's mounted by default. Formerly you required to install "ncurses - term" to get it.
After that set the term type in.bashrc with something like the adhering to :
if [ -n "$DISPLAY" -a "$TERM" == "xterm" ]; then export TERM=xterm-256color fi
If you would certainly favor to just have the 256 colour capacity for sure programs (probably it perplexes a few other) make use of rather :
and also probably set that as a pen name for the program.
After that examine your incurable colour capacities with :
$ tput colors 256
You still might require the vim setup over to have vim acknowledge it. The majority of applications will certainly acknowledge the 256 colours instantly (if they can utilize them).
Emacs additionally has colour motifs that are better with 256 colours. To examine if it 256 - colour qualified run :
256colors.pl is Perl manuscript that will certainly present all the colours in your terminal.