LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Problem with zsh prompt ! (https://www.linuxquestions.org/questions/linux-newbie-8/problem-with-zsh-prompt-4175457688/)

Mony 04-10-2013 12:47 PM

Problem with zsh prompt !
 
hi

i can't set zsh prompt in the config
Code:

# Path to your oh-my-zsh configuration.
ZSH=$HOME/.oh-my-zsh

# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
# ZSH_THEME=""

# Example aliases
# alias zshconfig="mate ~/.zshrc"
# alias ohmyzsh="mate ~/.oh-my-zsh"

# Set to this to use case-sensitive completion
# CASE_SENSITIVE="true"

# Comment this out to disable bi-weekly auto-update checks
# DISABLE_AUTO_UPDATE="true"

# Uncomment to change how many often would you like to wait before auto-updates occur? (in days)
# export UPDATE_ZSH_DAYS=13

# Uncomment following line if you want to disable colors in ls
# DISABLE_LS_COLORS="true"

# Uncomment following line if you want to disable autosetting terminal title.
DISABLE_AUTO_TITLE="true"

# Uncomment following line if you want red dots to be displayed while waiting for completion
COMPLETION_WAITING_DOTS="true"

# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
plugins=(git archlinux extract themes)

source $ZSH/oh-my-zsh.sh

# Customize to your needs...

unsetopt extendedglob

export PATH=$PATH:$HOME/bin
EDITOR=vim

[ ! "$UID" = "0" ] && fortune | cowsay -f eyes

# dir colors
eval `dircolors ~/.dir_colors`

#-- Command Coloring --#
. live-command-coloring.sh

# Prompt
PROMPT="%{$fg[white]%}%~%{$reset_color%} $(git_prompt_info)\
%{$fg[cyan]%}>%{$fg[white]%}>%{$fg[blue]%}>%{$reset_color%} "

ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[green]%}["
ZSH_THEME_GIT_PROMPT_SUFFIX="]%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_DIRTY=" %{$fg[red]%}*%{$fg[green]%}"
ZSH_THEME_GIT_PROMPT_CLEAN=""

# title
[[ -t 1 ]] || return
case $TERM in
      *xterm*|*rxvt*|(dt|k|E|a)term)
    preexec () {
    print -Pn "\e]2;$1\a"
    }
    ;;
    screen*)
        preexec () {
        print -Pn "\e\"$1\e\134"           
    }
  ;;
esac
function precmd() {
        print -Pn "\e]2;%~\a"
}

# Misc
w3mimg () { w3m -o imgdisplay=/usr/lib/w3m/w3mimgdisplay $1 }

my prompt should be like this
Code:

~ <git>
>>>

but it look like this
Code:

mony@PC ~ (git)-[master] %
"grml prompt"
:(

gacanepa 04-10-2013 02:10 PM

If I am not mistaken, you are using ArchLinux, am I correct?
In this link you can find very useful information on Customizing your zsh prompt (official ArchWiki).
Also, since oh-my-zsh is a plugin and theme system for zsh and it's available in Github here, you can download the file named oh-my-zsh.sh and tweak it a little. Hopefully you will get the desired results.
You may especially want to take a look at $(git_prompt_info) in it.
Code:

# Prompt
PROMPT="%{$fg[white]%}%~%{$reset_color%} $(git_prompt_info)\
%{$fg[cyan]%}>%{$fg[white]%}>%{$fg[blue]%}>%{$reset_color%} "

Hope this helps. If so, please mark this thread as solved, or feel free to ask any other questions you may have.

bigrigdriver 04-10-2013 02:17 PM

Since zsh uses .zshrc (similar to .bashrc in bash) to set the PS1 (prompt) variable, you probably need to do something to tell zsh to use .oh.my.zsh instead of .zshrc. Something like
Code:

ln -s ~/oh-my-zsh.zshrc ~/.zshrc
Here is a thread at unix.stackexchange.com that explains it: http://unix.stackexchange.com/questi...-my-zsh-config

Mony 04-10-2013 02:33 PM

:D
Thanks guys
just removed the "grml-zsh-config" package


All times are GMT -5. The time now is 01:32 PM.