I was wondering why Mac Terminal doesn’t have nice color highlighting that all other Linux based OSs have. Suddenly realized that it should be enabled with few little things to get it done on Mac OS. Follow the few steps to make it highlighted. Before it was enabled my Mac terminal didn’t look any better as my Ubuntu terminal. It was like below.
1. Create a file named .profile if it doesn’t already exists. Add the following line for that file.
alias ls='ls -G'
This will add higlighting when you use, ls commands to list files and directories, better than looking at black color all the time.
2. Do the following to add highlighting for vi editor.
:~ cd /usr/share/vim/ :~ sudo vim vimrc
Add the following code after the line with ‘set backspace=2′
set ai " auto indenting
set history=100 " keep 100 lines of history
set ruler " show the cursor position
syntax on " syntax highlighting
set hlsearch " highlight the last searched term
filetype plugin on " use the file type plugins
" When editing a file, always jump to the last cursor position
autocmd BufReadPost *
\ if ! exists("g:leave_my_cursor_position_alone") |
\ if line("'\"") > 0 && line ("'\"") <= line("$") |
\ exe "normal g'\"" |
\ endif |
\ endif
Save the file with Esc + :wq. Now your vi editor will show source files with some highlighting as well.
OK. Now it looks far better with some colors after this.




Thanks Tharindu for this post!!
By: sandeep on February 27, 2012
at 8:48 AM
Thank you for this post! My terminal looks better now:)
By: Jiangwei on November 1, 2012
at 5:19 PM