LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > Other *NIX
User Name
Password
Other *NIX This forum is for the discussion of any UNIX platform that does not have its own forum. Examples would include HP-UX, IRIX, Darwin, Tru64 and OS X.

Notices



Reply
 
Search this Thread
Old 01-02-2005, 04:11 AM   #1
cseanburns
Member
 
Registered: Nov 2003
Distribution: Debian
Posts: 117

Rep: Reputation: 17
syntax highlighting for ls command and vim editor


I really like syntax highlighting in the Linux terminal for the ls command and in Vi or Vim. Mac OS X, it seems, doesn't have syntax highlighting as a default. It took me a little time to learn how to get it enabled, permanently, in OS X, so I thought I would share this with anyone else in case they want to enable it in Panther also, using the bash shell.

If you don't know what I'm talking about, in Panther, in the terminal, type ls -G. Files, directories, links, etc. are colorized differently. In order to make this permanent, in terminal, open the .bash_profile file, I use Vi, in your home directory and add these aliases:

alias ls="ls -G"
alias ls -l="ls -lG"
alias ls -al="ls -alG"

To enable syntax highlighting for Vi, I had to create a file called .vimrc in my home directory. Some people seem to have this file by default, I didn't. To create the file, type:

vi .vimrc

Add the following line to the file:

:syntax enable

Make sure your Terminal preferences are set to "xterm-color" as your terminal type. Usually this is default, but the easiest way to check: in the Terminal menu bar, scroll down to Preferences and open it or press the Command and comma button at the same time.

Log out and log back in for changes to take effect.

Last edited by cseanburns; 01-02-2005 at 04:16 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
RdHat Vim Syntax Highlighting R4z0r Linux - Software 8 09-06-2011 02:22 PM
vim syntax highlighting MiniMe001 Linux - General 2 06-19-2005 12:08 PM
Adding Syntax Highlighting to VIM TastyWheat Linux - Software 2 02-27-2004 04:37 AM
How to make vim has syntax highlighting ICO Linux - General 4 01-05-2004 11:35 AM
Vim syntax highlighting NSKL Linux - Software 2 11-09-2002 03:39 AM


All times are GMT -5. The time now is 10:16 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration