dotfiles

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

commit 0bbb0e38eb290defcbcd7a3123bd2bd3c93c155f
parent e286707f6e9ba34c9521b7ec6b805f2ae4e37c5e
Author: Janis Pagel <janis.pagel@ims.uni-stuttgart.de>
Date:   Tue, 22 Jan 2019 18:25:50 +0100

Change right prompt

Diffstat:
Mzsh/zsh_functions | 4++--
Mzsh/zshrc | 8+++-----
2 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/zsh/zsh_functions b/zsh/zsh_functions @@ -66,7 +66,7 @@ git_prompt_string() { # If inside a Git repository, print its branch and state [ -n "$git_where" ] && echo "$GIT_PROMPT_SYMBOL$(parse_git_state)$GIT_PROMPT_PREFIX%{$fg[yellow]%}${git_where#(refs/heads/|tags/)}$GIT_PROMPT_SUFFIX" - # If not inside the Git repo, print exit codes of last command (only if it failed) - [ ! -n "$git_where" ] && echo "%{$fg[red]%} %(?..[%?])" + # If not inside the Git repo, do nothing + [ ! -n "$git_where" ] && echo "" } diff --git a/zsh/zshrc b/zsh/zshrc @@ -102,7 +102,6 @@ colors # set left prompt PROMPT='%b%# %E' -# set right prompt ###### # This whole git prompt stuff was taken from Manjaro's zsh setup, slightly modified ###### @@ -117,19 +116,18 @@ GIT_PROMPT_MERGING="%{$fg_bold[magenta]%}!%{$reset_color%}" # merge conflict GIT_PROMPT_UNTRACKED="%{$fg_bold[red]%}+%{$reset_color%}" # untracked files GIT_PROMPT_MODIFIED="%{$fg_bold[yellow]%}+%{$reset_color%}" # tracked files modified GIT_PROMPT_STAGED="%{$fg_bold[green]%}->%{$reset_color%}" # staged changes present = ready for "git push" -RPROMPT='$(git_prompt_string)' # Right prompt with exit status of previous command if not successful -RPROMPT="$RPROMPT %{$fg[red]%} %(?..[%?])" +RPROMPT='$(git_prompt_string) %{$fg[red]%}%(?..[%?])%{$reset_color%} (%*)' ################# ##### Misc ###### ################# # TMUX -if [[ -z "$TMUX" ]] && [[ -n "$DISPLAY" ]] ;then # Test if tmux is running +if [[ -z "$TMUX" ]] && [[ -n "$DISPLAY" ]]; then # Test if tmux is running ID="$( tmux ls | grep -vm1 attached | cut -d: -f1 )" # get the id of a deattached session - if [[ -z "$ID" ]] ;then # if not available create a new one + if [[ -z "$ID" ]]; then # if not available create a new one tmux new-session else tmux attach-session -t "$ID" # if available attach to it