Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I have used oh_my_zsh (and tinkered with bash_it) on multiple systems and have generally been happy with it, though I hate it's auto-correction feature and generally turn it off.

My usual shell is zsh and I really want just three things from my prompt:

  1. Current directory/or pwd.

  2. Git status and branch.

  3. Color output from ls (on the ls command, not in the prompt).

The rest is just bling and is often irritating.

By using these shell scripts I am paying too much in cpu cycles for what I want.

Any suggestions, either with using these scripts or as a separate shell script. I am OK with either zsh or bash.

Thanks.

share|improve this question
    
Why do you want "colour output from ls" in your prompt?... –  Sardathrion Mar 19 '12 at 12:36
    
You could extract the for you relevant parts from the zsh config of grml (grml.org/zsh ). –  jofel Mar 19 '12 at 12:51
    
Not really in the prompt but I do want color output from ls. I guess it is not so much a prompt issue but I know it does involve some shell scripting. –  haziz Mar 19 '12 at 12:51
2  
Also asked on AskUbuntu: askubuntu.com/q/114227/10127 –  glenn jackman Mar 19 '12 at 13:22
add comment

closed as off-topic by jasonwryan, slm, Anthon, Zelda, Sukminder Jan 17 at 4:11

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question has been posted on multiple sites. Cross-posting is strongly discouraged; see the help center and community FAQ for more information." – jasonwryan, slm, Anthon, Zelda, Sukminder

2 Answers

up vote 2 down vote accepted

To have colored output from ls, use the alias ls='ls --color=always'. You can enable this with

alias ls='ls --color=always'

As for having your current directory in your prompt:

PROMPT='%~'

To add git status to you prompt, take a look at this.

share|improve this answer
    
--color=auto should of course DTRT if the detection works. –  XTL Mar 20 '12 at 10:16
add comment

I use this script from git/contrib with bash. It gives me git branch and autocompletion as well. git status can be hacked in pretty easily too, from what I understand.

share|improve this answer
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.