1
1
Fork 0

Update fish config for 3.1.0

This commit is contained in:
Jonathan Schleifer 2020-02-15 22:44:12 +00:00
parent b59c4cf08c
commit fa3797e7c6
9 changed files with 69 additions and 50 deletions

View file

@ -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

View file

@ -1,7 +1,10 @@
function cd --description 'Change directory'
#
# 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")
return 1
end
@ -38,9 +41,21 @@ function cd --description 'Change directory'
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
# If dirprev, dirnext, __fish_cd_direction
# are set as universal variables, honor their scope.
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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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!"