1
1
Fork 0

Consistent indenting for .fish files

This commit is contained in:
Jonathan Schleifer 2020-02-19 21:46:19 +00:00
parent ce52fc5aff
commit d5b9a71d71
18 changed files with 106 additions and 93 deletions

View file

@ -1,20 +1,19 @@
function prompt_pwd --description 'Print the current working directory'
set -l options 'h/help'
argparse -n prompt_pwd --max-args=0 $options -- $argv
or return
set -l options 'h/help'
argparse -n prompt_pwd --max-args=0 $options -- $argv
or return
if set -q _flag_help
__fish_print_help prompt_pwd
return 0
end
if set -q _flag_help
__fish_print_help prompt_pwd
return 0
end
# Replace $HOME with "~"
set realhome ~
set -l tmp (string replace -r '^'"$realhome"'($|/)' '~$1' $PWD)
set tmp (basename $tmp)
# Replace $HOME with "~"
set realhome ~
set -l tmp (basename (string replace -r '^'"$realhome"'($|/)' '~$1' $PWD))
test $PWD = "/$tmp"
and set tmp $PWD
test $PWD = "/$tmp"
and set tmp $PWD
echo $tmp
echo $tmp
end