Add fish config
This commit is contained in:
parent
c5a1b43a04
commit
bff3bbf87d
6 changed files with 117 additions and 0 deletions
2
config/fish/.gitignore
vendored
Normal file
2
config/fish/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
fishd.*
|
||||||
|
fish_history
|
36
config/fish/functions/cd.fish
Normal file
36
config/fish/functions/cd.fish
Normal file
|
@ -0,0 +1,36 @@
|
||||||
|
# vim: se ts=4:
|
||||||
|
|
||||||
|
function cd --description 'Change directory'
|
||||||
|
# Skip history in subshells
|
||||||
|
if status --is-command-substitution
|
||||||
|
builtin cd $argv
|
||||||
|
return $status
|
||||||
|
end
|
||||||
|
|
||||||
|
# Avoid set completions
|
||||||
|
set -l previous $PWD
|
||||||
|
|
||||||
|
if test $argv[1] = - ^/dev/null
|
||||||
|
if test "$__fish_cd_direction" = next ^/dev/null
|
||||||
|
nextd
|
||||||
|
else
|
||||||
|
prevd
|
||||||
|
end
|
||||||
|
return $status
|
||||||
|
end
|
||||||
|
|
||||||
|
builtin cd $argv[1]
|
||||||
|
set -l cd_status $status
|
||||||
|
|
||||||
|
if test $cd_status = 0 -a "$PWD" != "$previous"
|
||||||
|
set -g dirprev $dirprev $previous
|
||||||
|
set -e dirnext
|
||||||
|
set -g __fish_cd_direction prev
|
||||||
|
end
|
||||||
|
|
||||||
|
if test $cd_status = 0
|
||||||
|
ls
|
||||||
|
end
|
||||||
|
|
||||||
|
return $cd_status
|
||||||
|
end
|
30
config/fish/functions/fish_prompt.fish
Normal file
30
config/fish/functions/fish_prompt.fish
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
# vim: se ts=4:
|
||||||
|
|
||||||
|
function fish_prompt --description 'Write out the prompt'
|
||||||
|
set -l last_status $status
|
||||||
|
|
||||||
|
if not set -q __fish_prompt_normal
|
||||||
|
set -g __fish_prompt_normal (set_color normal)
|
||||||
|
end
|
||||||
|
|
||||||
|
set_color $fish_color_hostname
|
||||||
|
echo -n (hostname -s)
|
||||||
|
set_color $fish_color_hostname_colon
|
||||||
|
echo -n :
|
||||||
|
|
||||||
|
# PWD
|
||||||
|
set_color $fish_color_cwd
|
||||||
|
echo -n (prompt_pwd)
|
||||||
|
echo -n $__fish_prompt_normal
|
||||||
|
|
||||||
|
echo -n (__fish_git_prompt)
|
||||||
|
|
||||||
|
set_color $fish_color_prompt
|
||||||
|
if [ $USER = root ]
|
||||||
|
echo -n '# '
|
||||||
|
else
|
||||||
|
echo -n '$ '
|
||||||
|
end
|
||||||
|
|
||||||
|
echo -n $__fish_prompt_normal
|
||||||
|
end
|
27
config/fish/functions/fish_reset_colors.fish
Normal file
27
config/fish/functions/fish_reset_colors.fish
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
# vim: se ts=4:
|
||||||
|
|
||||||
|
function fish_reset_colors --description 'Reset all colors'
|
||||||
|
set -U fish_color_autosuggestion 555 yellow
|
||||||
|
set -U fish_color_command 5f87ff
|
||||||
|
set -U fish_color_comment 5f0000
|
||||||
|
set -U fish_color_cwd 00af5f
|
||||||
|
set -U fish_color_cwd_root red
|
||||||
|
set -U fish_color_end normal
|
||||||
|
set -U fish_color_error af0000
|
||||||
|
set -U fish_color_escape cyan
|
||||||
|
set -U fish_color_history_current cyan
|
||||||
|
set -U fish_color_hostname 87af5f
|
||||||
|
set -U fish_color_hostname_colon 808080
|
||||||
|
set -U fish_color_jobs ffaf00
|
||||||
|
set -U fish_color_match cyan
|
||||||
|
set -U fish_color_normal normal
|
||||||
|
set -U fish_color_operator cyan
|
||||||
|
set -U fish_color_param 87afff
|
||||||
|
set -U fish_color_prompt afd7af
|
||||||
|
set -U fish_color_quote af5f00
|
||||||
|
set -U fish_color_redirection 875f87
|
||||||
|
set -U fish_color_search_match --background=purple
|
||||||
|
set -U fish_color_status $fish_color_error[1]
|
||||||
|
set -U fish_color_valid_path --underline
|
||||||
|
set -U __fish_git_prompt_color af875f
|
||||||
|
end
|
17
config/fish/functions/fish_right_prompt.fish
Normal file
17
config/fish/functions/fish_right_prompt.fish
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
# vim: se ts=4:
|
||||||
|
|
||||||
|
function fish_right_prompt --description 'Write out the right prompt'
|
||||||
|
set -l last_status $status
|
||||||
|
|
||||||
|
if [ (count (jobs)) -gt 0 ]
|
||||||
|
set_color $fish_color_jobs
|
||||||
|
echo -n " "(count (jobs))
|
||||||
|
end
|
||||||
|
|
||||||
|
if [ $last_status != 0 ]
|
||||||
|
set_color $fish_color_status
|
||||||
|
echo -n " $last_status"
|
||||||
|
end
|
||||||
|
|
||||||
|
echo -n " "
|
||||||
|
end
|
5
config/fish/functions/sprunge.fish
Normal file
5
config/fish/functions/sprunge.fish
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
# vim: se ts=4:
|
||||||
|
|
||||||
|
function sprunge --description 'Paste to sprunge'
|
||||||
|
curl -F "sprunge=<-" http://sprunge.us
|
||||||
|
end
|
Loading…
Add table
Add a link
Reference in a new issue