Skip to content

Commit 025c0e5

Browse files
itsxaosxaos
andauthored
Allow customizing path truncation (#308)
Co-authored-by: xaos <[email protected]>
1 parent 5a43c17 commit 025c0e5

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

functions/geometry_path

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# geometry_path - show the current path
22

33
geometry_path() {
4-
local dir=${GEOMETRY_PATH_SYMBOL_HOME:-"%3~"} # symbol representing the home directory
4+
local dir=${GEOMETRY_PATH_SYMBOL_HOME:-"%$GEOMETRY_PATH_TRUNCATE~"} # symbol representing the home directory
55
( ${GEOMETRY_PATH_SHOW_BASENAME:-false} ) && dir=${PWD:t}
66
ansi ${GEOMETRY_PATH_COLOR:-blue} $dir
77
}

geometry.zsh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ typeset -gA GEOMETRY; GEOMETRY[ROOT]=${0:A:h}
1111
(($+GEOMETRY_INFO)) || GEOMETRY_INFO=()
1212
(($+GEOMETRY_TITLE)) || GEOMETRY_TITLE=(geometry_path)
1313
(($+GEOMETRY_CMDTITLE)) || GEOMETRY_CMDTITLE=(geometry_cmd geometry_hostname)
14+
(($+GEOMETRY_PATH_TRUNCATE)) || GEOMETRY_PATH_TRUNCATE=3
1415

1516
autoload -U add-zsh-hook
1617

0 commit comments

Comments
 (0)