mirror of
https://github.com/IlanCosman/tide.git
synced 2024-09-11 09:05:37 +03:00
Use default name variables for pwd
This commit is contained in:
parent
67b1e76da3
commit
b90b041316
@ -10,14 +10,13 @@ function _tide_pwd
|
||||
set -l split_pwd_for_output $color_anchors$split_pwd[1]$reset_to_color_dirs $split_pwd[2..]
|
||||
set split_pwd_for_output[-1] $color_anchors$split_pwd[-1]$reset_to_color_dirs
|
||||
|
||||
set -l icon $tide_pwd_icon_dir' '
|
||||
if not test -w $PWD
|
||||
set icon $tide_pwd_icon_unwritable' '
|
||||
set -g tide_pwd_icon $tide_pwd_icon_unwritable' '
|
||||
else if test $PWD = $HOME
|
||||
set icon $tide_pwd_icon_home' '
|
||||
set -g tide_pwd_icon $tide_pwd_icon_home' '
|
||||
end
|
||||
|
||||
set -g pwd_length (string length "$icon"(string join / $split_pwd_for_length))
|
||||
set -g pwd_length (string length "$tide_pwd_icon"(string join / $split_pwd_for_length))
|
||||
|
||||
i=1 for dir_section in $split_pwd[2..-2]
|
||||
set -l parent_dir (string join -- / $split_pwd[..$i] | string replace '~' $HOME) # Uses i before increment
|
||||
@ -34,10 +33,10 @@ function _tide_pwd
|
||||
end
|
||||
set split_pwd_for_length[$i] $truncated
|
||||
set split_pwd_for_output[$i] $color_truncated_dirs$truncated$reset_to_color_dirs
|
||||
set pwd_length (string length "$icon"(string join / $split_pwd_for_length)) # Update length
|
||||
set pwd_length (string length "$tide_pwd_icon"(string join / $split_pwd_for_length)) # Update length
|
||||
end
|
||||
end
|
||||
|
||||
printf '%s' $reset_to_color_dirs $icon
|
||||
printf '%s' $reset_to_color_dirs $tide_pwd_icon
|
||||
string join -- / $split_pwd_for_output
|
||||
end
|
||||
|
@ -18,7 +18,7 @@ end
|
||||
|
||||
function _enable_icons
|
||||
set -p fake_tide_left_prompt_items os
|
||||
set -g fake_tide_pwd_icon_dir
|
||||
set -g fake_tide_pwd_icon
|
||||
set -g fake_tide_pwd_icon_home
|
||||
set -g fake_tide_cmd_duration_icon
|
||||
set -g fake_tide_git_icon
|
||||
@ -26,7 +26,7 @@ end
|
||||
|
||||
function _disable_icons
|
||||
_tide_find_and_remove os fake_tide_left_prompt_items
|
||||
set fake_tide_pwd_icon_dir
|
||||
set fake_tide_pwd_icon
|
||||
set fake_tide_pwd_icon_home
|
||||
set fake_tide_cmd_duration_icon
|
||||
set fake_tide_git_icon
|
||||
|
@ -57,7 +57,7 @@ tide_pwd_bg_color 444444
|
||||
tide_pwd_color_anchors $_tide_color_light_blue
|
||||
tide_pwd_color_dirs $_tide_color_dark_blue
|
||||
tide_pwd_color_truncated_dirs 8787AF
|
||||
tide_pwd_icon_dir
|
||||
tide_pwd_icon
|
||||
tide_pwd_icon_home
|
||||
tide_pwd_icon_unwritable ''
|
||||
tide_pwd_markers .bzr .citc .git .hg .node-version .python-version .ruby-version .shorten_folder_marker .svn .terraform Cargo.toml composer.json CVS go.mod package.json
|
||||
|
@ -57,7 +57,7 @@ tide_pwd_bg_color normal
|
||||
tide_pwd_color_anchors $_tide_color_light_blue
|
||||
tide_pwd_color_dirs $_tide_color_dark_blue
|
||||
tide_pwd_color_truncated_dirs 8787AF
|
||||
tide_pwd_icon_dir
|
||||
tide_pwd_icon
|
||||
tide_pwd_icon_home
|
||||
tide_pwd_icon_unwritable ''
|
||||
tide_pwd_markers .bzr .citc .git .hg .node-version .python-version .ruby-version .shorten_folder_marker .svn .terraform Cargo.toml composer.json CVS go.mod package.json
|
||||
|
@ -57,7 +57,7 @@ tide_pwd_bg_color 3465A4
|
||||
tide_pwd_color_anchors E4E4E4
|
||||
tide_pwd_color_dirs E4E4E4
|
||||
tide_pwd_color_truncated_dirs BCBCBC
|
||||
tide_pwd_icon_dir
|
||||
tide_pwd_icon
|
||||
tide_pwd_icon_home
|
||||
tide_pwd_icon_unwritable ''
|
||||
tide_pwd_markers .bzr .citc .git .hg .node-version .python-version .ruby-version .shorten_folder_marker .svn .terraform Cargo.toml composer.json CVS go.mod package.json
|
||||
|
@ -1,6 +1,6 @@
|
||||
function _fake_tide_item_pwd
|
||||
_fake_tide_print_item pwd \
|
||||
(set_color $fake_tide_pwd_color_dirs)$fake_tide_pwd_icon_dir' ' \
|
||||
(set_color $fake_tide_pwd_color_dirs)$fake_tide_pwd_icon' ' \
|
||||
(set_color -o $fake_tide_pwd_color_anchors)'~'(set_color normal -b $fake_tide_pwd_bg_color) \
|
||||
(set_color $fake_tide_pwd_color_dirs)'/'(set_color normal -b $fake_tide_pwd_bg_color) \
|
||||
(set_color -o $fake_tide_pwd_color_anchors)'src'(set_color normal -b $fake_tide_pwd_bg_color)
|
||||
|
Loading…
Reference in New Issue
Block a user