configs  Diff

Differences From Artifact [5e26245763]:

To Artifact [be6aa8e75b]:


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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

	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)

	test $PWD = "/$tmp"
	and set tmp $PWD

	echo $tmp
end

|
|
|

|
|
|
|

|
|
|
<

|
|

|

1
2
3
4
5
6
7
8
9
10
11
12
13

14
15
16
17
18
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

    if set -q _flag_help
        __fish_print_help prompt_pwd
        return 0
    end

    # Replace $HOME with "~"
    set realhome ~
    set -l tmp (basename (string replace -r '^'"$realhome"'($|/)' '~$1' $PWD))


    test $PWD = "/$tmp"
    and set tmp $PWD

    echo $tmp
end