Enabling Colors in PuTTY
First, you need to make sure your PuTTY sessions are configured to display colors.
As indicated in the PuTTY documentation, you should start your PuTTY client and then under the Window > Colours settings category, enable Allow terminal to use xterm 256-colour mode.
Enabling Command-Line Shell Colors
Enabling shell colors essentially involve two components: (a) coloring the output of an ls command, and (b) coloring the shell prompt.
The easiest way to color the output of ls commmand is, as this forum thread points out, to put the following lines in your .profile or .bashrc file (or in the system-wide /etc/profile file).
CLICOLOR="YES" export CLICOLOR LSCOLORS="ExGxFxdxCxDxDxhbadExEx" export LSCOLORS
For now, how to color the shell prompt is not covered here.
Enabling Syntax Highlighting in emacs
To get emacs to attempt to perform syntax highlighting, you must set the font-lock-mode of the buffer. The following explanation is an excerpt from the emacs manual:
font-lock-mode is the standard way to have Emacs perform syntax highlighting in the current buffer.
To automatically invoke font-lock-mode for all major modes, you can turn on global-font-lock-mode by including the following line in your `.emacs' file:(global-font-lock-mode 1)
To test whether emacs now displays colors, start emacs and then run M-x list-colors-display — i.e., press Alt-x, type list-colors-display, and then hit Enter. You should see a list of all the colors emacs knows how to display.
Download the file, and place it in your emacs load path — e.g., under /usr/local/share/emacs/site-lisp on FreeBSD). Then add the following lines to your .emacs file:
That’s it. Hope this was useful to some.