2022-05-06 12:12:01 +00:00
|
|
|
if status is-interactive
|
2022-07-26 01:03:01 +00:00
|
|
|
# Disable greeting
|
|
|
|
set -g fish_greeting
|
|
|
|
|
|
|
|
# Interactive environment variables
|
2022-10-03 00:53:41 +00:00
|
|
|
set -gx EDITOR ~/bin/nvim/bin/nvim
|
2022-06-14 15:45:37 +00:00
|
|
|
|
|
|
|
# Setup
|
|
|
|
## Zoxide
|
|
|
|
zoxide init fish | source
|
|
|
|
## Starship
|
|
|
|
starship init fish | source
|
2022-09-08 19:27:33 +00:00
|
|
|
## Atuin
|
|
|
|
set -gx ATUIN_NOBIND true
|
|
|
|
atuin init fish | source
|
|
|
|
bind \cr _atuin_search
|
2022-06-14 15:45:37 +00:00
|
|
|
|
2022-05-06 12:12:01 +00:00
|
|
|
# Abbreviations
|
|
|
|
## Replacements
|
2022-08-14 00:57:34 +00:00
|
|
|
abbr -ag rm trash
|
2022-05-06 12:12:01 +00:00
|
|
|
|
|
|
|
## Safety options
|
2022-08-14 00:57:34 +00:00
|
|
|
abbr -ag cp "cp -i"
|
|
|
|
abbr -ag mv "mv -i"
|
2022-08-24 21:48:52 +00:00
|
|
|
abbr -ag rmr "rm -r"
|
2022-05-06 12:12:01 +00:00
|
|
|
|
|
|
|
## Default options
|
2022-08-24 21:48:52 +00:00
|
|
|
set -g rsync "rsync -avhL --partial --zc=zstd --zl=8 --no-i-r --info=progress2"
|
2022-08-14 00:57:34 +00:00
|
|
|
abbr -ag rsync $rsync
|
2022-11-02 15:15:58 +00:00
|
|
|
abbr -ag onefetch "onefetch --no-color-palette"
|
2022-05-06 12:12:01 +00:00
|
|
|
|
|
|
|
## Podman
|
|
|
|
set -l sagemath_image docker.io/sagemath/sagemath:latest
|
2022-10-29 09:24:09 +00:00
|
|
|
abbr -ag sage "podman run --pull newer -it --rm $sagemath_image"
|
|
|
|
abbr -ag sage-jupyter "podman run --pull newer -it --rm -p8888:8888 $sagemath_image sage-jupyter"
|
2022-05-06 12:12:01 +00:00
|
|
|
|
2022-05-14 00:14:13 +00:00
|
|
|
set -l fedora_image registry.fedoraproject.org/fedora:(rpm -E %fedora)
|
2022-10-29 09:24:09 +00:00
|
|
|
abbr -ag fedora "podman run --pull newer -it --rm $fedora_image"
|
2022-05-06 12:12:01 +00:00
|
|
|
|
|
|
|
set -l asciidoctor_image docker.io/asciidoctor/docker-asciidoctor:latest
|
2022-10-29 09:24:09 +00:00
|
|
|
abbr -ag adoc "podman run --pull newer -it --rm -v (pwd):/documents/:Z $asciidoctor_image"
|
2022-08-14 00:57:34 +00:00
|
|
|
|
|
|
|
abbr -ag pps "podman ps --format '{{.Names}}'"
|
2022-05-06 12:12:01 +00:00
|
|
|
|
|
|
|
# Functions
|
|
|
|
## Replacements
|
|
|
|
function cd -w z
|
|
|
|
z $argv
|
|
|
|
end
|
|
|
|
|
2022-05-10 16:23:15 +00:00
|
|
|
function kssh -w ssh
|
2022-05-06 12:12:01 +00:00
|
|
|
kitty +kitten ssh $argv
|
|
|
|
end
|
|
|
|
|
|
|
|
function ls -w lsd
|
|
|
|
lsd $argv
|
|
|
|
end
|
|
|
|
|
|
|
|
function ll -w lsd
|
|
|
|
lsd -l $argv
|
|
|
|
end
|
|
|
|
|
|
|
|
function cat -w bat
|
|
|
|
bat $argv
|
|
|
|
end
|
|
|
|
|
2022-05-06 12:28:35 +00:00
|
|
|
function lg -w lazygit
|
|
|
|
lazygit $argv
|
|
|
|
end
|
|
|
|
|
2022-08-16 15:45:58 +00:00
|
|
|
function zola
|
|
|
|
flatpak run org.getzola.zola $argv
|
|
|
|
end
|
|
|
|
|
2022-09-26 14:21:10 +00:00
|
|
|
function julia
|
2022-11-02 15:15:58 +00:00
|
|
|
JULIA_NUM_THREADS=16 LD_PRELOAD=/usr/lib64/libstdc++.so.6 ~/.julia/juliaup/bin/julia $argv
|
2022-09-26 14:21:10 +00:00
|
|
|
end
|
|
|
|
|
2022-05-06 12:12:01 +00:00
|
|
|
## Taskwarrior
|
|
|
|
function ta -w task -d "Add no priority task"
|
|
|
|
task add project:$argv[1] $argv[2..]
|
|
|
|
end
|
|
|
|
|
|
|
|
function tal -w task -d "Add low priority task"
|
|
|
|
ta $argv priority:L
|
|
|
|
end
|
|
|
|
|
|
|
|
function tam -w task -d "Add medium priority task"
|
|
|
|
ta $argv priority:M
|
|
|
|
end
|
|
|
|
|
|
|
|
function tah -w task -d "Add high priority task"
|
|
|
|
ta $argv priority:H
|
|
|
|
end
|
|
|
|
|
|
|
|
function v -w task
|
|
|
|
vit $argv
|
|
|
|
end
|
|
|
|
|
|
|
|
function vp -w task
|
|
|
|
vit project:$argv[1] $argv[2..]
|
|
|
|
end
|
2022-05-10 16:23:15 +00:00
|
|
|
|
|
|
|
# Private config
|
|
|
|
set -l private_config ~/.config/fish/private_config.fish
|
|
|
|
if test -f $private_config
|
|
|
|
source $private_config
|
|
|
|
end
|
2022-05-06 12:12:01 +00:00
|
|
|
end
|