Macos – OSX Lion terminal lost all colors

colorsmacososx lionterminal

I recently upgraded to Lion only to find that Terminal.app (and iTerm2, which I actually use instead) have totally lost all colors. This means no syntax highlighting in Vim, no colored directory names or filenames, no nothing. I've tried playing around with the terminal-type option in the preferences (for both apps), changing it to xterm-256color, xterm-new, xterm, etc. but all to no avail.

However! When I SSH into a remote machine in Terminal.app, I get colors! Everything works as it once did. Although this isn't the same with iTerm2, where I'm still left colourless.

Best Answer

I had to edit ~/.profile and put this code in to make folders color.

export CLICOLOR=1
export LSCOLORS=ExFxCxDxBxegedabagacad

This shows LSCOLORS options.

I used this to make a custom cursor:

PS1='\[\033[01;32m\]\u@macair\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '

Hope this helps.

For vim, use a theme like this theme

And add 2 folders, ~/.vim and ~/.vim/colors

Put the theme file in your ~/.vim/colors folder

Then make a file called ~/.vimrc with something like this:

syntax on        'this is needed to see syntax
set background=dark  "makes it easier to read with black background
colorscheme ir_black "set theme in ./vim/colors folder
set ls=2            " allways show status line
set hlsearch        " highlight searches
"set incsearch       " do incremental searching
set ruler           " show the cursor position all the time
set visualbell t_vb=    " turn off error beep/flash
set ignorecase        "ignore case while searching
set number            'put numbers on side

I've added comments so you can pick and choose what you want. Also, I ended up tweaking the theme. It made comments grey and they were too hard to read.

Related Question