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

My .bashrc:

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

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.

migrated from stackoverflow.com Dec 29 '12 at 18:14

This question came from our site for professional and enthusiast programmers.

  • 1
    The 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 Dec 26 '12 at 1:44
  • This belongs on SuperUser or Unix & Linux. – CodeGnome Dec 29 '12 at 18:14

This script is from Fedora Project site:


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;;
  export TERM

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

unset local256

To test:

tput colors

Output should be 256


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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.