From 7399975870d46758d56ed1bfaf0e9818600ac009 Mon Sep 17 00:00:00 2001 From: Bartek Stalewski Date: Mon, 27 Jan 2020 11:42:06 +0100 Subject: [PATCH] Truncate to repo. --- zsh/p10k.zsh | 5 +++-- zsh/zshrc | 15 ++++++++++++--- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/zsh/p10k.zsh b/zsh/p10k.zsh index 1371822..df9d79c 100644 --- a/zsh/p10k.zsh +++ b/zsh/p10k.zsh @@ -232,6 +232,7 @@ # If directory is too long, shorten some of its segments to the shortest possible unique # prefix. The shortened directory can be tab-completed to the original. typeset -g POWERLEVEL9K_SHORTEN_STRATEGY=truncate_to_unique + typeset -g POWERLEVEL9K_DIR_TRUNCATE_BEFORE_MARKER=true # Replace removed segment suffixes with this symbol. typeset -g POWERLEVEL9K_SHORTEN_DELIMITER= # Color of the shortened directory segments. @@ -267,7 +268,7 @@ # directory will be shortened only when prompt doesn't fit or when other parameters demand it # (see POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS and POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS_PCT below). # If set to `0`, directory will always be shortened to its minimum length. - typeset -g POWERLEVEL9K_DIR_MAX_LENGTH=0 + typeset -g POWERLEVEL9K_DIR_MAX_LENGTH=80 # When `dir` segment is on the last prompt line, try to shorten it enough to leave at least this # many columns for typing commands. typeset -g POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS=40 @@ -399,7 +400,7 @@ fi # ⇣42 if behind the remote. - (( VCS_STATUS_COMMITS_BEHIND )) && res+=" ${clean}${VCS_STATUS_COMMITS_BEHIND}${conflicted}⇣${clear}" + (( VCS_STATUS_COMMITS_BEHIND )) && res+=" ${clean}${VCS_STATUS_COMMITS_BEHIND}${conflicted}⇣${clean}" # ⇡42 if ahead of the remote; no leading space if also behind the remote: ⇣42⇡42. (( VCS_STATUS_COMMITS_AHEAD && !VCS_STATUS_COMMITS_BEHIND )) && res+=" " (( VCS_STATUS_COMMITS_AHEAD )) && res+="${clean}${VCS_STATUS_COMMITS_AHEAD}${staged}⇡${clean}" diff --git a/zsh/zshrc b/zsh/zshrc index ab11d99..5cdda69 100644 --- a/zsh/zshrc +++ b/zsh/zshrc @@ -1,6 +1,3 @@ -HISTSIZE=10000 -SAVEHIST=$HISTSIZE -HISTFILE=~/.zsh_history autoload -U compinit && compinit autoload -U promptinit && promptinit @@ -19,4 +16,16 @@ source ~/.zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh source ~/.zsh/themes/powerlevel10k/powerlevel10k.zsh-theme [[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh +#function zsh_directory_name() { +# emulate -L zsh +# [[ $1 == d ]] || return +# while [[ $2 != / ]]; do +# if [[ -e $2/.git ]]; then +# typeset -ga reply=(${2:t} $#2) +# return +# fi +# 2=${2:h} +# done +# return 1 +#} [ -e ~/.zshrc.local ] && source ~/.zshrc.local