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