migrate to dotter
This commit is contained in:
parent
c5618f2f2c
commit
2da5ffd1f4
265 changed files with 62 additions and 3123 deletions
23
configs/fish/functions/_pure_parse_directory.fish
Normal file
23
configs/fish/functions/_pure_parse_directory.fish
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
function _pure_parse_directory \
|
||||
--description "Replace '$HOME' with '~'" \
|
||||
--argument-names max_path_length
|
||||
|
||||
set --local folder (fish_prompt_pwd_dir_length=$pure_shorten_prompt_current_directory_length prompt_pwd)
|
||||
|
||||
if test -n "$max_path_length"
|
||||
if test (string length $folder) -gt $max_path_length
|
||||
# If path exceeds maximum symbol limit, force fish path formating function to use 1 character
|
||||
set folder (fish_prompt_pwd_dir_length=1 prompt_pwd)
|
||||
end
|
||||
end
|
||||
|
||||
if test "$pure_truncate_prompt_current_directory_keeps" -ge 1
|
||||
set folder (
|
||||
string split '/' $folder \
|
||||
| tail -n $pure_truncate_prompt_current_directory_keeps \
|
||||
| string join '/'
|
||||
)
|
||||
end
|
||||
|
||||
echo $folder
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue