Update fish config for 3.1.0
This commit is contained in:
parent
b59c4cf08c
commit
fa3797e7c6
9 changed files with 69 additions and 50 deletions
|
@ -6,6 +6,7 @@ SETUVAR --export MAKEFLAGS:\x2dj\x2016
|
||||||
SETUVAR __fish_init_2_39_8:\x1d
|
SETUVAR __fish_init_2_39_8:\x1d
|
||||||
SETUVAR __fish_init_2_3_0:\x1d
|
SETUVAR __fish_init_2_3_0:\x1d
|
||||||
SETUVAR __fish_init_3_x:\x1d
|
SETUVAR __fish_init_3_x:\x1d
|
||||||
|
SETUVAR __fish_initialized:3100
|
||||||
SETUVAR _fish_abbr_gpg:gpg2
|
SETUVAR _fish_abbr_gpg:gpg2
|
||||||
SETUVAR _fish_abbr_vi:vim
|
SETUVAR _fish_abbr_vi:vim
|
||||||
SETUVAR fish_color_autosuggestion:303030
|
SETUVAR fish_color_autosuggestion:303030
|
||||||
|
@ -13,12 +14,14 @@ SETUVAR fish_color_cancel:normal
|
||||||
SETUVAR fish_color_command:205cb3
|
SETUVAR fish_color_command:205cb3
|
||||||
SETUVAR fish_color_comment:6600cc
|
SETUVAR fish_color_comment:6600cc
|
||||||
SETUVAR fish_color_cwd:209060
|
SETUVAR fish_color_cwd:209060
|
||||||
|
SETUVAR fish_color_cwd_root:red
|
||||||
SETUVAR fish_color_end:730099
|
SETUVAR fish_color_end:730099
|
||||||
SETUVAR fish_color_error:ff0000
|
SETUVAR fish_color_error:ff0000
|
||||||
SETUVAR fish_color_escape:00a6b2
|
SETUVAR fish_color_escape:00a6b2
|
||||||
SETUVAR fish_color_history_current:normal
|
SETUVAR fish_color_history_current:normal
|
||||||
SETUVAR fish_color_host:176945
|
SETUVAR fish_color_host:176945
|
||||||
SETUVAR fish_color_jobs:ffff00
|
SETUVAR fish_color_host_remote:yellow
|
||||||
|
SETUVAR fish_color_jobs:yellow
|
||||||
SETUVAR fish_color_match:normal
|
SETUVAR fish_color_match:normal
|
||||||
SETUVAR fish_color_normal:normal
|
SETUVAR fish_color_normal:normal
|
||||||
SETUVAR fish_color_operator:cc6fdf
|
SETUVAR fish_color_operator:cc6fdf
|
||||||
|
@ -27,6 +30,7 @@ SETUVAR fish_color_quote:ff751a
|
||||||
SETUVAR fish_color_redirection:bf4080
|
SETUVAR fish_color_redirection:bf4080
|
||||||
SETUVAR fish_color_search_match:ffff00
|
SETUVAR fish_color_search_match:ffff00
|
||||||
SETUVAR fish_color_selection:c0c0c0
|
SETUVAR fish_color_selection:c0c0c0
|
||||||
|
SETUVAR fish_color_status:red
|
||||||
SETUVAR fish_color_suffix:29bc7d
|
SETUVAR fish_color_suffix:29bc7d
|
||||||
SETUVAR fish_color_user:00ff00
|
SETUVAR fish_color_user:00ff00
|
||||||
SETUVAR fish_color_valid_path:normal
|
SETUVAR fish_color_valid_path:normal
|
||||||
|
|
|
@ -1,51 +1,66 @@
|
||||||
function cd --description 'Change directory'
|
#
|
||||||
set -l MAX_DIR_HIST 25
|
# Wrap the builtin cd command to maintain directory history.
|
||||||
|
#
|
||||||
|
function cd --description "Change directory"
|
||||||
|
set -l MAX_DIR_HIST 25
|
||||||
|
|
||||||
if test (count $argv) -gt 1
|
if test (count $argv) -gt (test "$argv[1]" = "--" && echo 2 || echo 1)
|
||||||
printf "%s\n" (_ "Too many args for cd command")
|
printf "%s\n" (_ "Too many args for cd command")
|
||||||
return 1
|
return 1
|
||||||
end
|
end
|
||||||
|
|
||||||
# Skip history in subshells.
|
# Skip history in subshells.
|
||||||
if status --is-command-substitution
|
if status --is-command-substitution
|
||||||
builtin cd $argv
|
builtin cd $argv
|
||||||
return $status
|
return $status
|
||||||
end
|
end
|
||||||
|
|
||||||
# Avoid set completions.
|
# Avoid set completions.
|
||||||
set -l previous $PWD
|
set -l previous $PWD
|
||||||
|
|
||||||
if test "$argv" = "-"
|
if test "$argv" = "-"
|
||||||
if test "$__fish_cd_direction" = "next"
|
if test "$__fish_cd_direction" = "next"
|
||||||
nextd
|
nextd
|
||||||
else
|
else
|
||||||
prevd
|
prevd
|
||||||
end
|
end
|
||||||
return $status
|
return $status
|
||||||
end
|
end
|
||||||
|
|
||||||
# allow explicit "cd ." if the mount-point became stale in the meantime
|
# allow explicit "cd ." if the mount-point became stale in the meantime
|
||||||
if test "$argv" = "."
|
if test "$argv" = "."
|
||||||
cd "$PWD"
|
cd "$PWD"
|
||||||
return $status
|
return $status
|
||||||
end
|
end
|
||||||
|
|
||||||
builtin cd $argv
|
builtin cd $argv
|
||||||
set -l cd_status $status
|
set -l cd_status $status
|
||||||
|
|
||||||
if test $cd_status -eq 0 -a "$PWD" != "$previous"
|
if test $cd_status -eq 0 -a "$PWD" != "$previous"
|
||||||
set -q dirprev
|
set -q dirprev
|
||||||
or set -l dirprev
|
or set -l dirprev
|
||||||
set -q dirprev[$MAX_DIR_HIST]
|
set -q dirprev[$MAX_DIR_HIST]
|
||||||
and set -e dirprev[1]
|
and set -e dirprev[1]
|
||||||
set -g -a dirprev $previous
|
|
||||||
set -e dirnext
|
|
||||||
set -g __fish_cd_direction prev
|
|
||||||
end
|
|
||||||
|
|
||||||
if test $cd_status -eq 0
|
# If dirprev, dirnext, __fish_cd_direction
|
||||||
ls
|
# are set as universal variables, honor their scope.
|
||||||
end
|
|
||||||
|
|
||||||
return $cd_status
|
set -U -q dirprev
|
||||||
|
and set -U -a dirprev $previous
|
||||||
|
or set -g -a dirprev $previous
|
||||||
|
|
||||||
|
set -U -q dirnext
|
||||||
|
and set -U -e dirnext
|
||||||
|
or set -e dirnext
|
||||||
|
|
||||||
|
set -U -q __fish_cd_direction
|
||||||
|
and set -U __fish_cd_direction prev
|
||||||
|
or set -g __fish_cd_direction prev
|
||||||
|
end
|
||||||
|
|
||||||
|
if test $cd_status -eq 0
|
||||||
|
ls
|
||||||
|
end
|
||||||
|
|
||||||
|
return $cd_status
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
function fgrep
|
function fgrep
|
||||||
if which ggrep >/dev/null ^&1
|
if type -q ggrep
|
||||||
command ggrep -F --color=auto $argv
|
command ggrep -F --color=auto $argv
|
||||||
else
|
else
|
||||||
command fgrep --color=auto $argv
|
command fgrep --color=auto $argv
|
||||||
|
|
|
@ -2,7 +2,7 @@ function fish_prompt --description 'Write out the prompt'
|
||||||
set -l suffix
|
set -l suffix
|
||||||
switch "$USER"
|
switch "$USER"
|
||||||
case root toor
|
case root toor
|
||||||
set suffix (set_color ff0000)'#'
|
set suffix (set_color $fish_color_cwd_root)'#'
|
||||||
case '*'
|
case '*'
|
||||||
set suffix '>'
|
set suffix '>'
|
||||||
end
|
end
|
||||||
|
|
|
@ -7,7 +7,7 @@ function fish_right_prompt
|
||||||
and set -a prompt (set_color $fish_color_jobs)$jobs
|
and set -a prompt (set_color $fish_color_jobs)$jobs
|
||||||
|
|
||||||
test $code -gt 0
|
test $code -gt 0
|
||||||
and set -a prompt (set_color $fish_color_error)$code
|
and set -a prompt (set_color $fish_color_status)$code
|
||||||
|
|
||||||
echo $prompt
|
echo $prompt
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
function grep
|
function grep
|
||||||
if which ggrep >/dev/null ^&1
|
if type -q ggrep
|
||||||
command ggrep --color=auto $argv
|
command ggrep --color=auto $argv
|
||||||
else
|
else
|
||||||
command grep --color=auto $argv
|
command grep --color=auto $argv
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
function ls --description 'List contents of directory'
|
function ls --description 'List contents of directory'
|
||||||
if which gls >/dev/null ^&1
|
if type -q gls
|
||||||
command gls --color=auto $argv
|
command gls --color=auto $argv
|
||||||
else
|
else
|
||||||
command ls --color=auto $argv
|
command ls --color=auto $argv
|
||||||
|
|
|
@ -4,7 +4,7 @@ function make
|
||||||
# pkgsrc does not like MAKEFLAGS including -j
|
# pkgsrc does not like MAKEFLAGS including -j
|
||||||
set -lx MAKEFLAGS
|
set -lx MAKEFLAGS
|
||||||
|
|
||||||
if which bmake >/dev/null ^&1 && \
|
if type -q bmake
|
||||||
command bmake $argv
|
command bmake $argv
|
||||||
else
|
else
|
||||||
command make $argv
|
command make $argv
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
function pw
|
function pw
|
||||||
set -l clipboard
|
set -l clipboard
|
||||||
if which pbcopy >/dev/null ^&1
|
if type -q pbcopy
|
||||||
set clipboard pbcopy
|
set clipboard pbcopy
|
||||||
else if which xclip >/dev/null ^&1
|
else if type -q xclip
|
||||||
set clipboard xclip
|
set clipboard xclip
|
||||||
else
|
else
|
||||||
echo "No clipboard handler found!"
|
echo "No clipboard handler found!"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue