Basic rice set up. Still need to add a way to reiably update the package lists and i need a launcher.
This commit is contained in:
commit
3e89f350a6
107 changed files with 7553 additions and 0 deletions
89
private_dot_config/private_fish/conf.d/atuin.fish
Normal file
89
private_dot_config/private_fish/conf.d/atuin.fish
Normal file
|
|
@ -0,0 +1,89 @@
|
|||
set -gx ATUIN_SESSION (atuin uuid)
|
||||
set --erase ATUIN_HISTORY_ID
|
||||
|
||||
function _atuin_preexec --on-event fish_preexec
|
||||
if not test -n "$fish_private_mode"
|
||||
set -g ATUIN_HISTORY_ID (atuin history start -- "$argv[1]")
|
||||
end
|
||||
end
|
||||
|
||||
function _atuin_postexec --on-event fish_postexec
|
||||
set -l s $status
|
||||
|
||||
if test -n "$ATUIN_HISTORY_ID"
|
||||
ATUIN_LOG=error atuin history end --exit $s -- $ATUIN_HISTORY_ID &>/dev/null &
|
||||
disown
|
||||
end
|
||||
|
||||
set --erase ATUIN_HISTORY_ID
|
||||
end
|
||||
|
||||
function _atuin_search
|
||||
set -l keymap_mode
|
||||
switch $fish_key_bindings
|
||||
case fish_vi_key_bindings
|
||||
switch $fish_bind_mode
|
||||
case default
|
||||
set keymap_mode vim-normal
|
||||
case insert
|
||||
set keymap_mode vim-insert
|
||||
end
|
||||
case '*'
|
||||
set keymap_mode emacs
|
||||
end
|
||||
|
||||
# In fish 3.4 and above we can use `"$(some command)"` to keep multiple lines separate;
|
||||
# but to support fish 3.3 we need to use `(some command | string collect)`.
|
||||
# https://fishshell.com/docs/current/relnotes.html#id24 (fish 3.4 "Notable improvements and fixes")
|
||||
set -l ATUIN_H (ATUIN_SHELL=fish ATUIN_LOG=error ATUIN_QUERY=(commandline -b) atuin search --keymap-mode=$keymap_mode $argv -i 3>&1 1>&2 2>&3 | string collect)
|
||||
|
||||
if test -n "$ATUIN_H"
|
||||
if string match --quiet '__atuin_accept__:*' "$ATUIN_H"
|
||||
set -l ATUIN_HIST (string replace "__atuin_accept__:" "" -- "$ATUIN_H" | string collect)
|
||||
commandline -r "$ATUIN_HIST"
|
||||
commandline -f repaint
|
||||
commandline -f execute
|
||||
return
|
||||
else
|
||||
commandline -r "$ATUIN_H"
|
||||
end
|
||||
end
|
||||
|
||||
commandline -f repaint
|
||||
end
|
||||
|
||||
function _atuin_bind_up
|
||||
# Fallback to fish's builtin up-or-search if we're in search or paging mode
|
||||
if commandline --search-mode; or commandline --paging-mode
|
||||
up-or-search
|
||||
return
|
||||
end
|
||||
|
||||
# Only invoke atuin if we're on the top line of the command
|
||||
set -l lineno (commandline --line)
|
||||
|
||||
switch $lineno
|
||||
case 1
|
||||
_atuin_search --shell-up-key-binding
|
||||
case '*'
|
||||
up-or-search
|
||||
end
|
||||
end
|
||||
|
||||
if string match -q '4.*' $version
|
||||
bind ctrl-r _atuin_search
|
||||
bind up _atuin_bind_up
|
||||
if bind -M insert >/dev/null 2>&1
|
||||
bind -M insert ctrl-r _atuin_search
|
||||
# bind -M insert up _atuin_bind_up
|
||||
end
|
||||
else
|
||||
bind \cr _atuin_search
|
||||
bind -k up _atuin_bind_up
|
||||
bind \eOA _atuin_bind_up
|
||||
bind \e\[A _atuin_bind_up
|
||||
if bind -M insert >/dev/null 2>&1
|
||||
bind -M insert \cr _atuin_search
|
||||
# bind -M insert -k up _atuin_bind_up; bind -M insert \eOA _atuin_bind_up; bind -M insert \e\[A _atuin_bind_up
|
||||
end
|
||||
end
|
||||
120
private_dot_config/private_fish/conf.d/theme.fish.tmpl
Normal file
120
private_dot_config/private_fish/conf.d/theme.fish.tmpl
Normal file
|
|
@ -0,0 +1,120 @@
|
|||
set color00 {{substr 0 2 .colors.base00}}/{{substr 2 4 .colors.base00}}/{{substr 4 6 .colors.base00}} # Base 00 - Black
|
||||
set color01 {{substr 0 2 .colors.base08}}/{{substr 2 4 .colors.base08}}/{{substr 4 6 .colors.base08}} # Base 08 - Red
|
||||
set color02 {{substr 0 2 .colors.base0B}}/{{substr 2 4 .colors.base0B}}/{{substr 4 6 .colors.base0B}} # Base 0B - Green
|
||||
set color03 {{substr 0 2 .colors.base0A}}/{{substr 2 4 .colors.base0A}}/{{substr 4 6 .colors.base0A}} # Base 0A - Yellow
|
||||
set color04 {{substr 0 2 .colors.base0D}}/{{substr 2 4 .colors.base0D}}/{{substr 4 6 .colors.base0D}} # Base 0D - Blue
|
||||
set color05 {{substr 0 2 .colors.base0E}}/{{substr 2 4 .colors.base0E}}/{{substr 4 6 .colors.base0E}} # Base 0E - Magenta
|
||||
set color06 {{substr 0 2 .colors.base0C}}/{{substr 2 4 .colors.base0C}}/{{substr 4 6 .colors.base0C}} # Base 0C - Cyan
|
||||
set color07 {{substr 0 2 .colors.base05}}/{{substr 2 4 .colors.base05}}/{{substr 4 6 .colors.base05}} # Base 05 - White
|
||||
set color08 {{substr 0 2 .colors.base03}}/{{substr 2 4 .colors.base03}}/{{substr 4 6 .colors.base03}} # Base 03 - Bright Black
|
||||
set color09 $color01 # Base 08 - Bright Red
|
||||
set color10 $color02 # Base 0B - Bright Green
|
||||
set color11 $color03 # Base 0A - Bright Yellow
|
||||
set color12 $color04 # Base 0D - Bright Blue
|
||||
set color13 $color05 # Base 0E - Bright Magenta
|
||||
set color14 $color06 # Base 0C - Bright Cyan
|
||||
set color15 {{substr 0 2 .colors.base07}}/{{substr 2 4 .colors.base07}}/{{substr 4 6 .colors.base07}} # Base 07 - Bright White
|
||||
set color16 {{substr 0 2 .colors.base09}}/{{substr 2 4 .colors.base09}}/{{substr 4 6 .colors.base09}} # Base 09
|
||||
set color17 {{substr 0 2 .colors.base0F}}/{{substr 2 4 .colors.base0F}}/{{substr 4 6 .colors.base0F}} # Base 0F
|
||||
set color18 {{substr 0 2 .colors.base01}}/{{substr 2 4 .colors.base01}}/{{substr 4 6 .colors.base01}} # Base 01
|
||||
set color19 {{substr 0 2 .colors.base02}}/{{substr 2 4 .colors.base02}}/{{substr 4 6 .colors.base02}} # Base 02
|
||||
set color20 {{substr 0 2 .colors.base04}}/{{substr 2 4 .colors.base04}}/{{substr 4 6 .colors.base04}} # Base 04
|
||||
set color21 {{substr 0 2 .colors.base06}}/{{substr 2 4 .colors.base06}}/{{substr 4 6 .colors.base06}} # Base 06
|
||||
set colorfg $color07 # Base 05 - White
|
||||
set colorbg $color00 # Base 00 - Black
|
||||
|
||||
if test -n "$TMUX"
|
||||
# Tell tmux to pass the escape sequences through
|
||||
# (Source: http://permalink.gmane.org/gmane.comp.terminal-emulators.tmux.user/1324)
|
||||
function put_template; printf '\033Ptmux;\033\033]4;%d;rgb:%s\033\033\\\033\\' $argv; end;
|
||||
function put_template_var; printf '\033Ptmux;\033\033]%d;rgb:%s\033\033\\\033\\' $argv; end;
|
||||
function put_template_custom; printf '\033Ptmux;\033\033]%s%s\033\033\\\033\\' $argv; end;
|
||||
else if string match 'screen*' $TERM # [ "${TERM%%[-.]*}" = "screen" ]
|
||||
# GNU screen (screen, screen-256color, screen-256color-bce)
|
||||
function put_template; printf '\033P\033]4;%d;rgb:%s\007\033\\' $argv; end;
|
||||
function put_template_var; printf '\033P\033]%d;rgb:%s\007\033\\' $argv; end;
|
||||
function put_template_custom; printf '\033P\033]%s%s\007\033\\' $argv; end;
|
||||
else if string match 'linux*' $TERM # [ "${TERM%%-*}" = "linux" ]
|
||||
function put_template; test $argv[1] -lt 16 && printf "\e]P%x%s" $argv[1] (echo $argv[2] | sed 's/\///g'); end;
|
||||
function put_template_var; true; end;
|
||||
function put_template_custom; true; end;
|
||||
else
|
||||
function put_template; printf '\033]4;%d;rgb:%s\033\\' $argv; end;
|
||||
function put_template_var; printf '\033]%d;rgb:%s\033\\' $argv; end;
|
||||
function put_template_custom; printf '\033]%s%s\033\\' $argv; end;
|
||||
end
|
||||
|
||||
# 16 color space
|
||||
put_template 0 $color00
|
||||
put_template 1 $color01
|
||||
put_template 2 $color02
|
||||
put_template 3 $color03
|
||||
put_template 4 $color04
|
||||
put_template 5 $color05
|
||||
put_template 6 $color06
|
||||
put_template 7 $color07
|
||||
put_template 8 $color08
|
||||
put_template 9 $color09
|
||||
put_template 10 $color10
|
||||
put_template 11 $color11
|
||||
put_template 12 $color12
|
||||
put_template 13 $color13
|
||||
put_template 14 $color14
|
||||
put_template 15 $color15
|
||||
|
||||
# 256 color space
|
||||
put_template 16 $color16
|
||||
put_template 17 $color17
|
||||
put_template 18 $color18
|
||||
put_template 19 $color19
|
||||
put_template 20 $color20
|
||||
put_template 21 $color21
|
||||
|
||||
# foreground / background / cursor color
|
||||
if test -n "$ITERM_SESSION_ID"
|
||||
# iTerm2 proprietary escape codes
|
||||
put_template_custom Pg {{.colors.base05}} # foreground
|
||||
put_template_custom Ph {{.colors.base00}} # background
|
||||
put_template_custom Pi {{.colors.base05}} # bold color
|
||||
put_template_custom Pj {{.colors.base02}} # selection color
|
||||
put_template_custom Pk {{.colors.base05}} # selected text color
|
||||
put_template_custom Pl {{.colors.base05}} # cursor
|
||||
put_template_custom Pm {{.colors.base00}} # cursor text
|
||||
else
|
||||
put_template_var 10 $colorfg
|
||||
if [ "$BASE16_SHELL_SET_BACKGROUND" != false ]
|
||||
put_template_var 11 $colorbg
|
||||
if string match 'rxvt*' $TERM # [ "${TERM%%-*}" = "rxvt" ]
|
||||
put_template_var 708 $colorbg # internal border (rxvt)
|
||||
end
|
||||
end
|
||||
put_template_custom 12 ";7" # cursor (reverse video)
|
||||
end
|
||||
|
||||
# set syntax highlighting colors
|
||||
set -U fish_color_autosuggestion {{.colors.base02}}
|
||||
set -U fish_color_cancel -r
|
||||
set -U fish_color_command green #white
|
||||
set -U fish_color_comment {{.colors.base02}}
|
||||
set -U fish_color_cwd green
|
||||
set -U fish_color_cwd_root red
|
||||
set -U fish_color_end brblack #blue
|
||||
set -U fish_color_error red
|
||||
set -U fish_color_escape yellow #green
|
||||
set -U fish_color_history_current --bold
|
||||
set -U fish_color_host normal
|
||||
set -U fish_color_match --background=brblue
|
||||
set -U fish_color_normal normal
|
||||
set -U fish_color_operator blue #green
|
||||
set -U fish_color_param {{.colors.base04}}
|
||||
set -U fish_color_quote yellow #brblack
|
||||
set -U fish_color_redirection cyan
|
||||
set -U fish_color_search_match bryellow --background={{.colors.base02}}
|
||||
set -U fish_color_selection white --bold --background={{.colors.base02}}
|
||||
set -U fish_color_status red
|
||||
set -U fish_color_user brgreen
|
||||
set -U fish_color_valid_path --underline
|
||||
set -U fish_pager_color_completion normal
|
||||
set -U fish_pager_color_description yellow --dim
|
||||
set -U fish_pager_color_prefix white --bold #--underline
|
||||
set -U fish_pager_color_progress brwhite --background=cyan
|
||||
Loading…
Add table
Add a link
Reference in a new issue