Add fish config
This commit is contained in:
parent
5cfa457ce6
commit
359ab04faa
|
@ -0,0 +1,5 @@
|
|||
# Automatically generated or machine specific variables
|
||||
fish_variables
|
||||
|
||||
# Machine specific fishd
|
||||
fishd.*
|
|
@ -0,0 +1,16 @@
|
|||
#!/bin/fish
|
||||
|
||||
# Disable the greeting
|
||||
set fish_greeting
|
||||
|
||||
## Application-specific configurations
|
||||
|
||||
# opam
|
||||
if test -e ~/.opam/opam-init/init.fish
|
||||
source ~/.opam/opam-init/init.fish > /dev/null 2> /dev/null; or true
|
||||
end
|
||||
|
||||
# direnv/envrc
|
||||
if type -q direnv
|
||||
direnv hook fish | source
|
||||
end
|
|
@ -0,0 +1,33 @@
|
|||
# This file is automatically generated by the fish.
|
||||
# Do NOT edit it directly, your changes will be overwritten.
|
||||
SET __fish_classic_git_prompt_initialized:\x1d
|
||||
SET __fish_init_2_39_8:\x1d
|
||||
SET __fish_init_2_3_0:\x1d
|
||||
SET fish_color_autosuggestion:b2b2b2
|
||||
SET fish_color_cancel:\x2dr
|
||||
SET fish_color_command:ffaf00
|
||||
SET fish_color_comment:5C9900
|
||||
SET fish_color_cwd:green
|
||||
SET fish_color_cwd_root:red
|
||||
SET fish_color_end:005fff
|
||||
SET fish_color_error:ff5f00
|
||||
SET fish_color_escape:bryellow\x1e\x2d\x2dbold
|
||||
SET fish_color_history_current:\x2d\x2dbold
|
||||
SET fish_color_host:normal
|
||||
SET fish_color_match:\x2d\x2dbackground\x3dbrblue
|
||||
SET fish_color_normal:normal
|
||||
SET fish_color_operator:bryellow
|
||||
SET fish_color_param:00afd7
|
||||
SET fish_color_quote:00d7af
|
||||
SET fish_color_redirection:7CB02C
|
||||
SET fish_color_search_match:bryellow\x1e\x2d\x2dbackground\x3dbrblack
|
||||
SET fish_color_selection:white\x1e\x2d\x2dbold\x1e\x2d\x2dbackground\x3dbrblack
|
||||
SET fish_color_status:red
|
||||
SET fish_color_user:brgreen
|
||||
SET fish_color_valid_path:\x2d\x2dunderline
|
||||
SET fish_greeting:\x1d
|
||||
SET fish_key_bindings:fish_default_key_bindings
|
||||
SET fish_pager_color_completion:\x1d
|
||||
SET fish_pager_color_description:B3A06D\x1eyellow
|
||||
SET fish_pager_color_prefix:white\x1e\x2d\x2dbold\x1e\x2d\x2dunderline
|
||||
SET fish_pager_color_progress:brwhite\x1e\x2d\x2dbackground\x3dcyan
|
|
@ -0,0 +1,24 @@
|
|||
#!/bin/fish
|
||||
|
||||
function fish_mode_prompt --description 'Displays the current vi mode'
|
||||
# Do nothing if not in vi mode
|
||||
if test "$fish_key_bindings" = "fish_vi_key_bindings"
|
||||
switch $fish_bind_mode
|
||||
case default
|
||||
set_color --bold red
|
||||
echo -n 🅽
|
||||
case insert
|
||||
set_color --bold green
|
||||
echo -n 🅸
|
||||
case replace_one
|
||||
set_color --bold green
|
||||
echo -n 🆁
|
||||
case visual
|
||||
set_color --bold brblue
|
||||
echo -n 🆅
|
||||
end
|
||||
set_color normal
|
||||
echo -n ' '
|
||||
end
|
||||
end
|
||||
|
|
@ -0,0 +1,78 @@
|
|||
#!/bin/fish
|
||||
|
||||
set PROMPTDIRS "~":$HOME
|
||||
|
||||
#
|
||||
# This function takes the $PROMPTDIRS variable and tries to shorten the
|
||||
# input (i.e. $argv[1]) w.r.t. the variable.
|
||||
#
|
||||
# e.g. If $PROMPTDIRS contains the pair $PR:$HOME/Projects,
|
||||
#
|
||||
# (prompt_abbr ~/Projects/Applications)
|
||||
#
|
||||
# will show "$PR/Applications", and ~/Projects will be converted to $PR.
|
||||
#
|
||||
# To set multiple $PROMPTDIRS entry, use successive (where $ABBR is some
|
||||
# directory to be abbreviated)
|
||||
#
|
||||
# set PROMPTDIRS \$ABBR:$ABBR $PROMPTDIRS
|
||||
#
|
||||
# with the outermost directory being set first.
|
||||
#
|
||||
function prompt_abbr
|
||||
set in $argv[1]
|
||||
|
||||
for d in $PROMPTDIRS
|
||||
set -l kv (string split -m 1 ":" $d)
|
||||
|
||||
switch "$in"
|
||||
case "$kv[2]/*"
|
||||
set in (string replace $kv[2] $kv[1] $in)
|
||||
break
|
||||
case "$kv[2]"
|
||||
set in "$kv[1]"
|
||||
break
|
||||
case "*"
|
||||
end
|
||||
end
|
||||
echo "$in"
|
||||
end
|
||||
|
||||
function fish_prompt
|
||||
# set_color white
|
||||
# echo -n '['
|
||||
|
||||
set -l FishStatusCodeCache $status
|
||||
|
||||
set_color -o 00FF00
|
||||
echo -n (whoami)
|
||||
|
||||
set_color normal
|
||||
echo -n '@'
|
||||
|
||||
set_color AFD75F
|
||||
echo -n (hostname)
|
||||
|
||||
set_color white
|
||||
echo -n ':'
|
||||
|
||||
set_color 8787FF
|
||||
echo -n (prompt_abbr $PWD)
|
||||
|
||||
set_color 5F87D7
|
||||
echo -n (__fish_vcs_prompt)
|
||||
|
||||
if test $FishStatusCodeCache -eq 0
|
||||
#set_color 18C412
|
||||
else
|
||||
set_color E84505
|
||||
echo -n " [$FishStatusCodeCache]"
|
||||
end
|
||||
|
||||
# set_color white
|
||||
# echo -n "]"
|
||||
|
||||
set_color -o white
|
||||
echo -n "> "
|
||||
set_color normal
|
||||
end
|
|
@ -0,0 +1,8 @@
|
|||
#!/bin/fish
|
||||
|
||||
function fish_right_prompt
|
||||
set_color grey
|
||||
printf (date '+%H:%M:%S')
|
||||
set_color normal
|
||||
end
|
||||
|
Loading…
Reference in New Issue