[TriLUG] FC3 changes

Scott G. Hall ScottGHall at BellSouth.Net
Wed Feb 23 13:58:43 EST 2005


ON 02-22-2005 16:31 EST, "H. Crissman" wrote:
> I am looking to make a couple of modifications to my recently installed
> FC3 system. Don't really know where to start but to compare to my other
> mandrake systems. First, in mdk, if I type "ls" in the console I get a
> list of files, dirs, and links all formated different colors (ie.
> dirs=blue, links=green, etc.) Is there a config file in FC3 where I can
> apply a similar color scheme? Is this even a FC3 thing or is it a Gnome
> thing? Next, I have a similar issue in vim. If I "vi fileX" there is a
> color syntax that makes reading config files quite nice. But, if I sudo
> vi fileX, that color syntax is no more. Once again is there a config
> file I can edit to enable this feature?

For *ls* environment variables; for *vi*, you want it linked to *vim*,
and check its initializations.

I include this in my .bashrc (similar for .kshrc or .cshrc depending on
your login shell):

     export LS_OPTIONS='-FCh'
         # enable color support of ls
         if [ "$TERM" != "dumb" ]; then
             eval `dircolors -b`
             LS_OPTIONS="$LS_OPTIONS --color=auto"
         fi
     alias ls='ls $LS_OPTIONS'

The *dircolors* utility spits back the following:
(2 lines - I stretched it, backslashes and newlines are mine)

LS_COLORS='no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:do=01;35:\
bd=40;33;01:cd=40;33;01:or=40;31;01:ex=01;32:*.tar=01;31:*.tgz=01;31:\
*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:\
*.gz=01;31:*.bz2=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.jpg=01;35:\
*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:\
*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:\
*.mpg=01;35:*.mpeg=01;35:*.avi=01;35:*.fli=01;35:*.gl=01;35:*.dl=01;35:\
*.xcf=01;35:*.xwd=01;35:*.ogg=01;35:*.mp3=01;35:*.wav=01;35:';
export LS_COLORS

To check if your *vi* is actually *vim*, try: /bin/vi or /usr/bin/vi
It should bring up a splash screen.  That confirmed, the initialization
file that turns on syntax highlighting is: (vim version not withstanding)
/usr/share/vim/vim61/syntax/syntax.vim

This file alone explains a lot.  Also if you coming in from an X-Windows
desktop, try *gvim*, the gui version (may or may not be enabled).

-- 
Scott G. Hall
Raleigh, NC, USA
ScottGHall at BellSouth.Net



More information about the TriLUG mailing list