feat: declare fish configuration
parent
7ffeb3e1e7
commit
8b28f0d487
|
@ -1 +1 @@
|
||||||
/gnu/store/v25gcy86bbakrzg500529k0zfaxwgapv-fish-config.fish
|
/gnu/store/xv3r12wjaiicylxh19xdhwjj2m33h7cl-fish-config.fish
|
|
@ -2,11 +2,10 @@ abbr --add m 'yt-dlp --prefer-free-formats --extract-audio'
|
||||||
abbr --add v 'yt-dlp --prefer-free-formats'
|
abbr --add v 'yt-dlp --prefer-free-formats'
|
||||||
abbr --add mpv --position anywhere --set-cursor=! 'mpv "!"'
|
abbr --add mpv --position anywhere --set-cursor=! 'mpv "!"'
|
||||||
|
|
||||||
abbr --add !config --position anywhere 'guix system reconfigure /etc/config.scm'
|
abbr --add !system --position anywhere 'doas guix system reconfigure /etc/config.scm'
|
||||||
abbr --add !home --position anywhere 'guix home reconfigure $HOME/projects/guile/radix/radio.scm'
|
abbr --add !home --position anywhere 'guix home reconfigure $HOME/projects/guile/radix/radio.scm'
|
||||||
abbr --add :config --position anywhere '$EDITOR /etc/config.scm'
|
abbr --add :system --position anywhere '$EDITOR /etc/config.scm'
|
||||||
abbr --add :home --position anywhere '$EDITOR $HOME/projects/guile/radix/radio.scm'
|
abbr --add :home --position anywhere '$EDITOR $HOME/projects/guile/radix/radio.scm'
|
||||||
abbr --add @radix --position anywhere '$HOME/projects/guile/radix'
|
abbr --add @radix --position anywhere '$HOME/projects/guile/radix'
|
||||||
abbr --add @files --position anywhere '$HOME/projects/guile/radix/files'
|
abbr --add @files --position anywhere '$HOME/projects/guile/radix/files'
|
||||||
abbr --add @system --position anywhere '$HOME/projects/guile/radix/modules/radix/services'
|
abbr --add @modules --position anywhere '$HOME/projects/guile/radix/modules'
|
||||||
abbr --add @home --position anywhere '$HOME/projects/guile/radix/modules/radix/home/services'
|
|
||||||
|
|
|
@ -1,31 +0,0 @@
|
||||||
# This file contains fish universal variable definitions.
|
|
||||||
# VERSION: 3.0
|
|
||||||
SETUVAR __fish_initialized:3400
|
|
||||||
SETUVAR fish_color_autosuggestion:555\x1ebrblack
|
|
||||||
SETUVAR fish_color_cancel:\x2dr
|
|
||||||
SETUVAR fish_color_command:blue
|
|
||||||
SETUVAR fish_color_comment:red
|
|
||||||
SETUVAR fish_color_cwd:green
|
|
||||||
SETUVAR fish_color_cwd_root:red
|
|
||||||
SETUVAR fish_color_end:green
|
|
||||||
SETUVAR fish_color_error:brred
|
|
||||||
SETUVAR fish_color_escape:brcyan
|
|
||||||
SETUVAR fish_color_history_current:\x2d\x2dbold
|
|
||||||
SETUVAR fish_color_host:normal
|
|
||||||
SETUVAR fish_color_host_remote:yellow
|
|
||||||
SETUVAR fish_color_normal:normal
|
|
||||||
SETUVAR fish_color_operator:brcyan
|
|
||||||
SETUVAR fish_color_param:cyan
|
|
||||||
SETUVAR fish_color_quote:yellow
|
|
||||||
SETUVAR fish_color_redirection:cyan\x1e\x2d\x2dbold
|
|
||||||
SETUVAR fish_color_search_match:bryellow\x1e\x2d\x2dbackground\x3dbrblack
|
|
||||||
SETUVAR fish_color_selection:white\x1e\x2d\x2dbold\x1e\x2d\x2dbackground\x3dbrblack
|
|
||||||
SETUVAR fish_color_status:red
|
|
||||||
SETUVAR fish_color_user:brgreen
|
|
||||||
SETUVAR fish_color_valid_path:\x2d\x2dunderline
|
|
||||||
SETUVAR fish_key_bindings:fish_default_key_bindings
|
|
||||||
SETUVAR fish_pager_color_completion:normal
|
|
||||||
SETUVAR fish_pager_color_description:B3A06D\x1eyellow\x1e\x2di
|
|
||||||
SETUVAR fish_pager_color_prefix:normal\x1e\x2d\x2dbold\x1e\x2d\x2dunderline
|
|
||||||
SETUVAR fish_pager_color_progress:brwhite\x1e\x2d\x2dbackground\x3dcyan
|
|
||||||
SETUVAR fish_pager_color_selected_background:\x2dr
|
|
|
@ -0,0 +1 @@
|
||||||
|
/gnu/store/75f2bk5sgw862xm3jg8zl0kl8d7r07kw-fish_variables
|
|
@ -0,0 +1 @@
|
||||||
|
/gnu/store/r17n4grhqa12hfvgjkrqyddy7ksavj9a-fish_greeting.fish
|
|
@ -1,70 +0,0 @@
|
||||||
# Utilities
|
|
||||||
|
|
||||||
function blue
|
|
||||||
set_color blue; printf $argv; set_color normal
|
|
||||||
end
|
|
||||||
function normal
|
|
||||||
set_color normal; printf $argv; set_color normal
|
|
||||||
end
|
|
||||||
|
|
||||||
function displayed_string_length
|
|
||||||
string replace -ra -- '\x1b.*?[mGKH]' '' "$argv" | string length
|
|
||||||
end
|
|
||||||
|
|
||||||
function padding
|
|
||||||
printf "%-"$argv[1]"s%s" " " "$output"
|
|
||||||
end
|
|
||||||
|
|
||||||
# Current working directory prompt
|
|
||||||
function fish_cwd_prompt
|
|
||||||
set -l cwd (pwd)
|
|
||||||
switch "$cwd"
|
|
||||||
case "$HOME"
|
|
||||||
printf "~"
|
|
||||||
case "/"
|
|
||||||
printf "/"
|
|
||||||
case "*"
|
|
||||||
set -l parent_dir (basename (dirname $cwd))
|
|
||||||
test $parent_dir = "/" || printf "%s" $parent_dir
|
|
||||||
printf '/%s' (basename $cwd)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
# Guix environment prompt
|
|
||||||
function fish_environment_prompt
|
|
||||||
normal "(env "; blue "%s" (basename $GUIX_ENVIRONMENT); normal ")"
|
|
||||||
end
|
|
||||||
|
|
||||||
# Actual prompt
|
|
||||||
function fish_prompt
|
|
||||||
if test -n "$GUIX_ENVIRONMENT"
|
|
||||||
set -l fish_environment_prompt_length \
|
|
||||||
(displayed_string_length (fish_environment_prompt))
|
|
||||||
set -l fish_git_prompt_length \
|
|
||||||
(displayed_string_length (fish_git_prompt))
|
|
||||||
|
|
||||||
fish_environment_prompt
|
|
||||||
printf (padding (math $COLUMNS - $fish_environment_prompt_length \
|
|
||||||
- $fish_git_prompt_length))
|
|
||||||
fish_git_prompt | string replace -ra ' ' ''
|
|
||||||
printf '\n'
|
|
||||||
else
|
|
||||||
function fish_right_prompt
|
|
||||||
fish_git_prompt
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
set -g fish_key_bindings fish_vi_key_bindings
|
|
||||||
switch "$fish_key_bindings"
|
|
||||||
case fish_vi_key_bindings fish_hybrid_key_bindings
|
|
||||||
test $fish_bind_mode = 'default' && normal ':' || normal '+'
|
|
||||||
end
|
|
||||||
|
|
||||||
blue (whoami); normal ' at '; blue (prompt_hostname)
|
|
||||||
normal ' in '; blue (fish_cwd_prompt)
|
|
||||||
normal ' > '
|
|
||||||
end
|
|
||||||
|
|
||||||
function fish_default_mode_prompt -d "Display vi prompt mode"
|
|
||||||
# Do nothing
|
|
||||||
end
|
|
|
@ -0,0 +1 @@
|
||||||
|
/gnu/store/8mh31d3qyd2gnkqa6zgnnaiyskrk96dm-fish_prompt.fish
|
10
radio.scm
10
radio.scm
|
@ -188,10 +188,10 @@
|
||||||
"application/pdf"
|
"application/pdf"
|
||||||
"application/epub+zip"))))))
|
"application/epub+zip"))))))
|
||||||
|
|
||||||
; (simple-service 'application-configs home-xdg-configuration-files-service-type
|
(simple-service 'application-configs home-xdg-configuration-files-service-type
|
||||||
; `(("fish/fish_variables" ,file:fish-variables)
|
`(("fish/fish_variables" ,file:fish-variables)
|
||||||
; ("fish/functions/fish_greeting.fish" ,file:fish-functions-greeting)
|
("fish/functions/fish_greeting.fish" ,file:fish-functions-greeting)
|
||||||
; ("fish/functions/fish_prompt.fish" ,file:fish-functions-prompt)))
|
("fish/functions/fish_prompt.fish" ,file:fish-functions-prompt)))
|
||||||
|
|
||||||
#|Shepherd service|#
|
#|Shepherd service|#
|
||||||
(service home-shepherd-service-type)
|
(service home-shepherd-service-type)
|
||||||
|
@ -284,7 +284,7 @@
|
||||||
'("/run/current-system/profile"
|
'("/run/current-system/profile"
|
||||||
"$XDG_CONFIG_HOME/guix/current"
|
"$XDG_CONFIG_HOME/guix/current"
|
||||||
"$HOME/.guix-home/profile")))
|
"$HOME/.guix-home/profile")))
|
||||||
":" 'infix))
|
":" 'infix))
|
||||||
|
|
||||||
#|GUIX|#
|
#|GUIX|#
|
||||||
("GUIX_PROFILE" . "$XDG_CONFIG_HOME/guix/current")
|
("GUIX_PROFILE" . "$XDG_CONFIG_HOME/guix/current")
|
||||||
|
|
Loading…
Reference in New Issue