Monday, January 31, 2011

Cygwin: Coloring CLI

I've got this from someone who share it in the internet, so the credit should goes to him/ her :) This is just a note-taking, so I can search it on the archive in the future.

Add these lines to .vimrc file which located on your $HOME directory (or create one if you can't find one):

" Switch syntax highlighting on, when the terminal has colors
" Also switch on highlighting the last used search pattern.
if &t_Co > 2 || has("gui_running")
  syntax on
  set hlsearch
endif

And for your Cygwin CLI, so you can see clearly. Add this line to your .bashrc file on your $HOME directory:
alias ls="ls -CF --color"

That's it.. restart your Cygwin, and you'll find the differences :)