CL VIM: How to get 256 color support in Fedora 17 terminal?

3

How do I enable 256 color support for VIM in the Fedora 17 terminal?

My .bashrc:

1 # .bashrc
2 
3 # Makes terminal default 256 Colors Include these lines in .bashrc
4 
5 export TERM=xterm-256color
6 
7 # User specific aliases and functions
8 
9 alias rm='rm -i'
10 alias cp='cp -i'
11 alias mv='mv -i'
12 
13 # Source global definitions
14 if [ -f /etc/bashrc ]; then
15         . /etc/bashrc
16 fi
17

Tput colors return 8, I am using 256 jellybeans for vim color, it changes some of the colors, but does not nearly work as shown in the screenshot (due to the fact the terminal only supports 8 colors)

Thanks in advance.

Drew Rygh

Posted 2012-12-26T01:39:13.297

Reputation: 33

1The TERM environment variable is only informative. It tells Apps what terminal you are currently using. It doesn't change the behaviour of the terminal. The terminal sets it to what it should be. You don't usually change it. Just make sure you are using a terminal with 256 color support first. – Keith – 2012-12-26T01:44:14.967

This belongs on SuperUser or Unix & Linux. – CodeGnome – 2012-12-29T18:14:14.810

Answers

1

This script is from Fedora Project site:

local256="$COLORTERM$XTERM_VERSION$ROXTERM_ID$KONSOLE_DBUS_SESSION"

if [ -n "$local256" ] || [ -n "$SEND_256_COLORS_TO_REMOTE" ]; then

  case "$TERM" in
    'xterm') TERM=xterm-256color;;
    'screen') TERM=screen-256color;;
    'Eterm') TERM=Eterm-256color;;
  esac
  export TERM

  if [ -n "$TERMCAP" ] && [ "$TERM" = "screen-256color" ]; then
    TERMCAP=$(echo "$TERMCAP" | sed -e 's/Co#8/Co#256/g')
    export TERMCAP
  fi
fi

unset local256

To test:

tput colors

Output should be 256

perreal

Posted 2012-12-26T01:39:13.297

Reputation: 663

0

I have this line in my .vimrc file:

set t_Co=256

Here is some additional information as well: http://vim.wikia.com/wiki/256_colors_in_vim

squiguy

Posted 2012-12-26T01:39:13.297

Reputation: 168