Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

okie2004

macrumors newbie
Original poster
Nov 8, 2004
3
0
I recently switched to a 12" PB running 10.3.5 with 768Mb of RAM. Most recently I noticed that my Terminal.app does not show color text for ls or syntax highlighting for vim, as it did "out of the box".

I have followed some hints and threads that talk about setting up aliases for li and vim to enable color highlighting, however, this was not the original setup which is what I am trying to obtain once again. The following are some bits of information that might be of some help.

* I am using the default bash shell
* My term variable is set to xterm-color
* I use the following .bash_profile
#source .bashrc if it's there
if [-f ~/.bashrc ]; then
. ~/.bashrc
fi

#environment aliases
alias start_tomcat="$CATALINA_HOME/bin/startup.sh"
alias stop_tomcat="$CATALINA_HOME/bin/shutdown.sh"

#environment variable
export CATALINA_HOME=/usr/local/jakarta-tomcat-5.0.28
export ANT_HOME=/usr/local/apache-ant-1.6.2
export JAVA_HOME=/usr

#set path to include java development
export PATH=$PATH :$CATALINA_HOME/bin:$ANT_HOME/bin
* I do not have a ~/.bashrc file
* I deleted the preferences file ("~/Library/Preferences/com.apple.Terminal.plist") and restarted the application. I was able to reset the window settings but still not color text for ls or vim

I knew about using "ls -G" to enable color for directory listing and I could even set it as an alias in my .bash_profile file but I am trying to figure out what changed from the setup I had when I got the powerbook.

I am assuming that the original installation defines an alias for "ls" as "ls -G" and another one to enable color syntax for vim, however I would like to know where these are created on a default installation. For example, in a Fedora installation, a file /etc/profile.d/colorls.sh creates the appropriate alias for color syntax, but aside from a user's .bashrc or .bash_profile, how does Panther allow for this?

Thank you for any you advice or suggestions you might have available.
 
musicpyrite said:
ummm.... you know you can change all that by selecting Terminal>Window Settings... don't you?

musicpyrite,

thanks for your reply, however I am not sure that I can change what I am looking for from the window settings -- unless I am not looking at the right place. Under window settings, I can change the background and the "normal and bold text". But it does not give me the option to select a color for, say, directories.

If you run "ls -G" is the behavior that was enabled for a simple "ls" when I first got the pb. Also, the sytax highlighting for vim is not addressed by the window settings. I thought it could be related somehow and that is why I deleted my preferences file to being with. That set my window settings back to their default values but I still don't have syntax highlighting.

If you execute a simple "ls" on your terminal, do you see directories in a different color than a normal file? If not, execute ls -G to see if that gives you a different listing.
 
ohhh, ok. I was a little confused by your question, I've never heard of doing that before. I'll keep an eye on this thread, this is something I'll want to learn.
 
Just been looking into this as the lack of syntax highlighting has been annoying me since switching to OSX and am part wayto a solution...

It seems Terminal isn't respecting the declare terminal type ($TERM) as: xterm-color for some reason, manually doing:

export TERM=xterm-color

Fixes this and then a :syntax on in vi will then work, which you can also place in your .vimrc for it to be permanent.

Okay well I think I have got a complete solution add the following lines to your ~/.profile (or create one if you don't have one):

export TERM=xterm-color
alias ls="ls -G"

then login again and all should be sweet. :)

Not sure why this would work by default and then not for you though...

Cheers,
Jason
 
jaseone said:
Okay well I think I have got a complete solution add the following lines to your ~/.profile (or create one if you don't have one):

Jason,

That is exactly what I have as well while I try to figure out what happen. I am using .bash_profile instead of .profile for the ls -G alias. For vim, since I don't use it as often, I just use :syntax on once I am in the editor.

Can anyone else confirm if syntax highlighting for ls and vim is ther on a default installation?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.