Consistent indenting for .fish files
This commit is contained in:
parent
ce52fc5aff
commit
d5b9a71d71
18 changed files with 106 additions and 93 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue