2024-03-25 22:57:04 +01:00
|
|
|
set fish_greeting
|
2024-05-12 11:25:11 +02:00
|
|
|
set fish_emoji_width 2
|
2024-03-25 22:57:04 +01:00
|
|
|
|
|
|
|
fish_add_path $HOME/.cargo/bin
|
|
|
|
fish_add_path $HOME/bin
|
|
|
|
|
2024-03-26 20:28:34 +01:00
|
|
|
## Nix
|
2024-05-12 11:25:11 +02:00
|
|
|
set -gx LOCALE_ARCHIVE /usr/lib/locale/locale-archive
|
|
|
|
set -gx NIX_REMOTE daemon
|
2024-03-26 20:28:34 +01:00
|
|
|
fish_add_path $HOME/.nix-profile/bin
|
|
|
|
|
2024-03-25 22:57:04 +01:00
|
|
|
if status is-interactive
|
|
|
|
|
2024-03-26 20:28:34 +01:00
|
|
|
## Pager
|
2024-05-12 11:25:11 +02:00
|
|
|
set -gx LESS "--mouse --wheel-lines=1 -nRXF"
|
|
|
|
set -gx LESSCOLORIZER bat
|
|
|
|
set -gx LESSOPEN "|lesspipe.sh %s"
|
|
|
|
set -gx PAGER bat
|
|
|
|
set -gx BAT_PAGER "less -r"
|
2024-03-26 00:41:11 +01:00
|
|
|
|
2024-03-30 09:37:04 +01:00
|
|
|
## OpenTelemetry
|
2024-05-12 11:25:11 +02:00
|
|
|
set -gx OTEL_EXPORTER_OTLP_ENDPOINT https://otel.aarn.shelman.io
|
|
|
|
set -gx OTEL_RESOURCE_ATTRIBUTES instance=dln-dev
|
|
|
|
set -gx OTEL_LOG_LEVEL debug
|
2024-03-30 09:37:04 +01:00
|
|
|
|
2024-03-25 22:57:04 +01:00
|
|
|
## Utilities
|
|
|
|
|
2024-05-12 11:25:11 +02:00
|
|
|
set -gx EDITOR (which nvim)
|
|
|
|
set -gx VISUAL $EDITOR
|
|
|
|
set -gx SUDO_EDITOR $EDITOR
|
|
|
|
|
|
|
|
|
2024-04-01 15:41:02 +02:00
|
|
|
|
2024-03-25 22:57:04 +01:00
|
|
|
function tree
|
|
|
|
eza --tree --color=always $argv | bat --wrap=never
|
|
|
|
end
|
|
|
|
|
|
|
|
function rg --wraps rg --description 'ripgrep with bat'
|
|
|
|
/usr/bin/rg --color=always $argv | bat --wrap=never
|
|
|
|
end
|
|
|
|
|
|
|
|
## Directory jumping with frecency
|
|
|
|
|
|
|
|
function fre_after_cd --on-variable PWD
|
|
|
|
fre --add "$PWD"
|
|
|
|
end
|
|
|
|
|
|
|
|
function jump
|
2024-06-10 21:08:27 +02:00
|
|
|
set _dir $(fre --sorted | fzf --no-sort --border=rounded --layout=reverse '--bind=ctrl-g:become(br -f --conf ~/.config/broot/select.hjson $(git rev-parse --show-toplevel 2>/dev/null || pwd))')
|
2024-03-25 22:57:04 +01:00
|
|
|
[ -n "$_dir" ] && pushd $_dir >>/dev/null
|
|
|
|
commandline -f repaint
|
|
|
|
end
|
|
|
|
bind \cg jump
|
|
|
|
|
2024-05-25 20:08:07 +02:00
|
|
|
function git_jump
|
|
|
|
set _dir $(git rev-parse --show-toplevel 2>/dev/null || pwd)
|
|
|
|
if [ "$_dir" = "$PWD" ]
|
2024-06-25 19:47:40 +02:00
|
|
|
#set _dir $(br -f --conf ~/.config/broot/select.hjson)
|
|
|
|
set _dir $(br -f --conf "$HOME/.config/broot/conf.hjson")
|
2024-05-25 20:08:07 +02:00
|
|
|
end
|
|
|
|
[ -n "$_dir" ] && pushd $_dir >>/dev/null
|
|
|
|
commandline -f repaint
|
|
|
|
end
|
|
|
|
bind \c_ git_jump
|
|
|
|
|
|
|
|
function git_broot
|
|
|
|
br $(git rev-parse --show-toplevel 2>/dev/null || pwd)
|
|
|
|
commandline -f repaint
|
|
|
|
end
|
|
|
|
|
|
|
|
bind \ee git_broot
|
2024-05-24 16:15:55 +02:00
|
|
|
bind \eg gitui
|
|
|
|
|
|
|
|
|
2024-03-26 00:41:11 +01:00
|
|
|
## Kubernetes
|
|
|
|
fish_add_path $HOME/.krew/bin
|
2024-03-30 09:37:04 +01:00
|
|
|
# function kubectl --wraps kubectl
|
|
|
|
# command kubecolor $argv
|
|
|
|
# end
|
2024-03-25 22:57:04 +01:00
|
|
|
|
|
|
|
## History
|
|
|
|
|
2024-03-31 20:11:06 +02:00
|
|
|
# FIXME: how to use autin history for these?
|
|
|
|
bind \cn history-prefix-search-forward
|
|
|
|
bind \cp history-prefix-search-backward
|
2024-05-12 11:25:11 +02:00
|
|
|
# bind \cP _atuin_bind_up
|
|
|
|
bind \cJ forward-char
|
2024-03-31 20:11:06 +02:00
|
|
|
|
2024-03-25 22:57:04 +01:00
|
|
|
atuin init fish | source
|
|
|
|
end
|
|
|
|
|
|
|
|
## Direnv
|
|
|
|
direnv hook fish | source
|