Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

share|improve this question

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

2 Answers 2

up vote 1 down vote accepted

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

share|improve this answer

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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