Index: config/fish/functions/fgrep.fish ================================================================== --- config/fish/functions/fgrep.fish +++ config/fish/functions/fgrep.fish @@ -1,7 +1,7 @@ function fgrep - if type -q ggrep - command ggrep -F --color=auto $argv - else - command fgrep --color=auto $argv - end + if type -q ggrep + command ggrep -F --color=auto $argv + else + command fgrep --color=auto $argv + end end Index: config/fish/functions/fish_prompt.fish ================================================================== --- config/fish/functions/fish_prompt.fish +++ config/fish/functions/fish_prompt.fish @@ -1,22 +1,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) ' ' + 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 Index: config/fish/functions/fish_right_prompt.fish ================================================================== --- config/fish/functions/fish_right_prompt.fish +++ config/fish/functions/fish_right_prompt.fish @@ -1,15 +1,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 + 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 Index: config/fish/functions/fish_title.fish ================================================================== --- config/fish/functions/fish_title.fish +++ config/fish/functions/fish_title.fish @@ -1,3 +1,3 @@ function fish_title - echo (status current-command) · (prompt_pwd) · (prompt_hostname) + echo (status current-command) · (prompt_pwd) · (prompt_hostname) end Index: config/fish/functions/gpg-sftp.fish ================================================================== --- config/fish/functions/gpg-sftp.fish +++ config/fish/functions/gpg-sftp.fish @@ -1,4 +1,4 @@ function gpg-sftp - set -lx SSH_AUTH_SOCK $HOME/.gnupg/S.gpg-agent.ssh - sftp $argv + set -lx SSH_AUTH_SOCK $HOME/.gnupg/S.gpg-agent.ssh + sftp $argv end Index: config/fish/functions/gpg-ssh-add.fish ================================================================== --- config/fish/functions/gpg-ssh-add.fish +++ config/fish/functions/gpg-ssh-add.fish @@ -1,4 +1,4 @@ function gpg-ssh-add - set -lx SSH_AUTH_SOCK $HOME/.gnupg/S.gpg-agent.ssh - ssh-add $argv + set -lx SSH_AUTH_SOCK $HOME/.gnupg/S.gpg-agent.ssh + ssh-add $argv end Index: config/fish/functions/gpg-ssh.fish ================================================================== --- config/fish/functions/gpg-ssh.fish +++ config/fish/functions/gpg-ssh.fish @@ -1,4 +1,4 @@ function gpg-ssh - set -lx SSH_AUTH_SOCK $HOME/.gnupg/S.gpg-agent.ssh - ssh $argv + set -lx SSH_AUTH_SOCK $HOME/.gnupg/S.gpg-agent.ssh + ssh $argv end Index: config/fish/functions/grep.fish ================================================================== --- config/fish/functions/grep.fish +++ config/fish/functions/grep.fish @@ -1,7 +1,7 @@ function grep - if type -q ggrep - command ggrep --color=auto $argv - else - command grep --color=auto $argv - end + if type -q ggrep + command ggrep --color=auto $argv + else + command grep --color=auto $argv + end end Index: config/fish/functions/ixio.fish ================================================================== --- config/fish/functions/ixio.fish +++ config/fish/functions/ixio.fish @@ -1,3 +1,3 @@ function ixio - curl -F 'f:1=<-' ix.io + curl -F 'f:1=<-' ix.io end Index: config/fish/functions/ls.fish ================================================================== --- config/fish/functions/ls.fish +++ config/fish/functions/ls.fish @@ -1,7 +1,7 @@ function ls --description 'List contents of directory' - if type -q gls - command gls --color=auto $argv - else - command ls --color=auto $argv - end + if type -q gls + command gls --color=auto $argv + else + command ls --color=auto $argv + end end Index: config/fish/functions/make.fish ================================================================== --- config/fish/functions/make.fish +++ config/fish/functions/make.fish @@ -1,15 +1,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 + 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 Index: config/fish/functions/mpv.fish ================================================================== --- config/fish/functions/mpv.fish +++ config/fish/functions/mpv.fish @@ -1,5 +1,5 @@ # To work around mpv not liking locales that use , as a decimal separator function mpv - set -x LC_ALL C - command mpv $argv + set -lx LC_ALL C + command mpv $argv end Index: config/fish/functions/pkg_chk.fish ================================================================== --- config/fish/functions/pkg_chk.fish +++ config/fish/functions/pkg_chk.fish @@ -1,4 +1,4 @@ function pkg_chk - set -lx MAKEFLAGS - command pkg_chk $argv + set -lx MAKEFLAGS + command pkg_chk $argv end Index: config/fish/functions/pkg_rolling-replace.fish ================================================================== --- config/fish/functions/pkg_rolling-replace.fish +++ config/fish/functions/pkg_rolling-replace.fish @@ -1,4 +1,4 @@ function pkg_rolling-replace - set -lx MAKEFLAGS - command pkg_rolling-replace $argv + set -lx MAKEFLAGS + command pkg_rolling-replace $argv end Index: config/fish/functions/prompt_pwd.fish ================================================================== --- config/fish/functions/prompt_pwd.fish +++ config/fish/functions/prompt_pwd.fish @@ -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 - - 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 + 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 Index: config/fish/functions/pw.fish ================================================================== --- config/fish/functions/pw.fish +++ config/fish/functions/pw.fish @@ -1,13 +1,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 + 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 Index: config/fish/functions/pws.fish ================================================================== --- config/fish/functions/pws.fish +++ config/fish/functions/pws.fish @@ -0,0 +1,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 Index: config/fish/functions/url2pkg.fish ================================================================== --- config/fish/functions/url2pkg.fish +++ config/fish/functions/url2pkg.fish @@ -1,5 +1,5 @@ # pkgsrc does not like MAKEFLAGS being set function url2pkg - set -lx MAKEFLAGS - command url2pkg $argv + set -lx MAKEFLAGS + command url2pkg $argv end