configs  Check-in [bed5a23ae3]

Overview
Comment:Consistent indenting for .fish files
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: bed5a23ae3f85dd603ff701e87d922c40270fd6aa590d4120bc69cdc9ab448cc
User & Date: js 2020-02-19 21:46:19
Context
2020-02-20
21:16
fish: Add run command to run a command in the bg check-in: 92789c0ee5 user: js tags: trunk
2020-02-19
21:46
Consistent indenting for .fish files check-in: bed5a23ae3 user: js tags: trunk
2020-02-16
18:09
create_symlinks.sh: Only symlink as needed check-in: dfc76a33b7 user: js tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to config/fish/functions/fgrep.fish.

1
2
3
4
5
6
7
function fgrep
	if type -q ggrep
		command ggrep -F --color=auto $argv
	else
		command fgrep --color=auto $argv
	end
end

|
|
|
|
|

1
2
3
4
5
6
7
function fgrep
    if type -q ggrep
        command ggrep -F --color=auto $argv
    else
        command fgrep --color=auto $argv
    end
end

Changes to config/fish/functions/fish_prompt.fish.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
function fish_prompt --description 'Write out the prompt'
	set -l suffix
	switch "$USER"
		case root toor
			set suffix (set_color $fish_color_cwd_root)'#'
		case '*'
			set suffix '>'
	end

	set -l branch (git symbolic-ref HEAD 2>/dev/null)
	set branch (string replace -r "^refs/heads/" "" $branch)
	set -l vcs
	if test -n "$branch" -a "$branch" != "master"
		set vcs (set_color $fish_color_vcs_braces)"(" \
		    (set_color $fish_color_vcs)"$branch" \
		    (set_color $fish_color_vcs_braces)")"
	end

	echo -n -s (set_color $fish_color_host) (prompt_hostname) ' ' \
	    (set_color $fish_color_cwd) (prompt_pwd) (string join '' $vcs) \
	    (set_color $fish_color_suffix) $suffix (set_color normal) ' '
end

|
|
|
|
|
|
|

|
|
|
|
|
|
|
|

|
|
|

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
function fish_prompt --description 'Write out the prompt'
    set -l suffix
    switch "$USER"
        case root toor
            set suffix (set_color $fish_color_cwd_root)'#'
        case '*'
            set suffix '>'
    end

    set -l branch (git symbolic-ref HEAD 2>/dev/null)
    set branch (string replace -r "^refs/heads/" "" $branch)
    set -l vcs
    if test -n "$branch" -a "$branch" != "master"
        set vcs (set_color $fish_color_vcs_braces)"(" \
                (set_color $fish_color_vcs)"$branch" \
                (set_color $fish_color_vcs_braces)")"
    end

    echo -n -s (set_color $fish_color_host) (prompt_hostname) ' ' \
               (set_color $fish_color_cwd) (prompt_pwd) (string join '' $vcs) \
               (set_color $fish_color_suffix) $suffix (set_color normal) ' '
end

Changes to config/fish/functions/fish_right_prompt.fish.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
function fish_right_prompt
	set -l code $status
	set -l jobs (jobs | wc -l)
	set -l prompt

	test $jobs -gt 0
	and set -a prompt (set_color $fish_color_jobs)$jobs

	test $code -gt 0
	and set -a prompt (set_color $fish_color_status)$code

	echo $prompt

	set_color normal
end

|
|
|

|
|

|
|

|

|

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
function fish_right_prompt
    set -l code $status
    set -l jobs (jobs | wc -l)
    set -l prompt

    test $jobs -gt 0
    and set -a prompt (set_color $fish_color_jobs)$jobs

    test $code -gt 0
    and set -a prompt (set_color $fish_color_status)$code

    echo $prompt

    set_color normal
end

Changes to config/fish/functions/fish_title.fish.

1
2
3
function fish_title
	echo (status current-command) · (prompt_pwd) · (prompt_hostname)
end

|

1
2
3
function fish_title
    echo (status current-command) · (prompt_pwd) · (prompt_hostname)
end

Changes to config/fish/functions/gpg-sftp.fish.

1
2
3
4
function gpg-sftp
	set -lx SSH_AUTH_SOCK $HOME/.gnupg/S.gpg-agent.ssh
	sftp $argv
end

|
|

1
2
3
4
function gpg-sftp
    set -lx SSH_AUTH_SOCK $HOME/.gnupg/S.gpg-agent.ssh
    sftp $argv
end

Changes to config/fish/functions/gpg-ssh-add.fish.

1
2
3
4
function gpg-ssh-add
	set -lx SSH_AUTH_SOCK $HOME/.gnupg/S.gpg-agent.ssh
	ssh-add $argv
end

|
|

1
2
3
4
function gpg-ssh-add
    set -lx SSH_AUTH_SOCK $HOME/.gnupg/S.gpg-agent.ssh
    ssh-add $argv
end

Changes to config/fish/functions/gpg-ssh.fish.

1
2
3
4
function gpg-ssh
	set -lx SSH_AUTH_SOCK $HOME/.gnupg/S.gpg-agent.ssh
	ssh $argv
end

|
|

1
2
3
4
function gpg-ssh
    set -lx SSH_AUTH_SOCK $HOME/.gnupg/S.gpg-agent.ssh
    ssh $argv
end

Changes to config/fish/functions/grep.fish.

1
2
3
4
5
6
7
function grep
	if type -q ggrep
		command ggrep --color=auto $argv
	else
		command grep --color=auto $argv
	end
end

|
|
|
|
|

1
2
3
4
5
6
7
function grep
    if type -q ggrep
        command ggrep --color=auto $argv
    else
        command grep --color=auto $argv
    end
end

Changes to config/fish/functions/ixio.fish.

1
2
3
function ixio
	curl -F 'f:1=<-' ix.io
end

|

1
2
3
function ixio
    curl -F 'f:1=<-' ix.io
end

Changes to config/fish/functions/ls.fish.

1
2
3
4
5
6
7
function ls --description 'List contents of directory'
	if type -q gls
		command gls --color=auto $argv
	else
		command ls --color=auto $argv
	end
end

|
|
|
|
|

1
2
3
4
5
6
7
function ls --description 'List contents of directory'
    if type -q gls
        command gls --color=auto $argv
    else
        command ls --color=auto $argv
    end
end

Changes to config/fish/functions/make.fish.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# Automatically use bmake instead of make when using pkgsrc, if necessary
function make
	if string match -q -r '/pkgsrc$|/pkgsrc/' $PWD
		# pkgsrc does not like MAKEFLAGS including -j
		set -lx MAKEFLAGS

		if type -q bmake
			command bmake $argv
		else
			command make $argv
		end
	else
		command make $argv
	end
end


|
|
|

|
|
|
|
|
|
|
|

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# Automatically use bmake instead of make when using pkgsrc, if necessary
function make
    if string match -q -r '/pkgsrc$|/pkgsrc/' $PWD
        # pkgsrc does not like MAKEFLAGS including -j
        set -lx MAKEFLAGS

        if type -q bmake
            command bmake $argv
        else
            command make $argv
        end
    else
        command make $argv
    end
end

Changes to config/fish/functions/mpv.fish.

1
2
3
4
5
# To work around mpv not liking locales that use , as a decimal separator
function mpv
	set -x LC_ALL C
	command mpv $argv
end


|
|

1
2
3
4
5
# To work around mpv not liking locales that use , as a decimal separator
function mpv
    set -lx LC_ALL C
    command mpv $argv
end

Changes to config/fish/functions/pkg_chk.fish.

1
2
3
4
function pkg_chk
	set -lx MAKEFLAGS
	command pkg_chk $argv
end

|
|

1
2
3
4
function pkg_chk
    set -lx MAKEFLAGS
    command pkg_chk $argv
end

Changes to config/fish/functions/pkg_rolling-replace.fish.

1
2
3
4
function pkg_rolling-replace
	set -lx MAKEFLAGS
	command pkg_rolling-replace $argv
end

|
|

1
2
3
4
function pkg_rolling-replace
    set -lx MAKEFLAGS
    command pkg_rolling-replace $argv
end

Changes to config/fish/functions/prompt_pwd.fish.

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

Changes to config/fish/functions/pw.fish.

1
2
3
4
5
6
7
8
9
10
11
12
13
function pw
	set -l clipboard
	if type -q pbcopy
		set clipboard pbcopy
	else if type -q xclip
		set clipboard xclip
	else
		echo "No clipboard handler found!"
		return 1
	end

	cryptopassphrase -k ~/.scrypt-pwgen.key $argv | tr -d '\n' | $clipboard
end

|
|
|
|
|
|
|
|
|

|

1
2
3
4
5
6
7
8
9
10
11
12
13
function pw
    set -l clipboard
    if type -q pbcopy
        set clipboard pbcopy
    else if type -q xclip
        set clipboard xclip
    else
        echo "No clipboard handler found!"
        return 1
    end

    cryptopassphrase -k ~/.scrypt-pwgen.key $argv | tr -d '\n' | $clipboard
end

Added config/fish/functions/pws.fish.





























>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
function pws
    set -l clipboard
    if type -q pbcopy
        set clipboard pbcopy
    else if type -q xclip
        set clipboard xclip
    else
        echo "No clipboard handler found!"
        return 1
    end

    cryptopassphrase -k ~/.scrypt-pwgen-server.key $argv \
        | tr -d '\n' | $clipboard
end

Changes to config/fish/functions/url2pkg.fish.

1
2
3
4
5
# pkgsrc does not like MAKEFLAGS being set
function url2pkg
	set -lx MAKEFLAGS
	command url2pkg $argv
end


|
|

1
2
3
4
5
# pkgsrc does not like MAKEFLAGS being set
function url2pkg
    set -lx MAKEFLAGS
    command url2pkg $argv
end