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-08-05 11:46:13 +00:00
|
|
|
set -gx EDITOR /usr/bin/nvim
|
|
|
|
set -gx JULIA_NUM_THREADS 16
|
2022-06-14 15:45:37 +00:00
|
|
|
|
|
|
|
# Setup
|
|
|
|
## Zoxide
|
|
|
|
zoxide init fish | source
|
|
|
|
## Starship
|
|
|
|
starship init fish | source
|
|
|
|
## McFly
|
|
|
|
set -gx MCFLY_KEY_SCHEME vim
|
2022-07-14 16:29:49 +00:00
|
|
|
set -gx MCFLY_FUZZY 1
|
|
|
|
set -gx MCFLY_RESULTS 25
|
2022-06-14 15:45:37 +00:00
|
|
|
set -gx MCFLY_INTERFACE_VIEW BOTTOM
|
|
|
|
set -gx MCFLY_RESULTS_SORT LAST_RUN
|
|
|
|
set -gx MCFLY_HISTORY_LIMIT 10000
|
|
|
|
mcfly init fish | source
|
|
|
|
|
2022-05-06 12:12:01 +00:00
|
|
|
# Abbreviations
|
|
|
|
## Replacements
|
|
|
|
abbr -a -g rm trash
|
|
|
|
|
|
|
|
## Safety options
|
|
|
|
abbr -a -g cp "cp -i"
|
|
|
|
abbr -a -g mv "mv -i"
|
|
|
|
abbr -a -g rmi "rm -i"
|
|
|
|
|
|
|
|
## Default options
|
2022-07-26 01:03:01 +00:00
|
|
|
set -g rsync "rsync -ravhL --partial --zc=zstd --zl=10 --no-i-r --info=progress2,stats2"
|
|
|
|
abbr -a -g rsync $rsync
|
2022-05-23 16:56:02 +00:00
|
|
|
abbr -a -g onefetch "onefetch --no-palette"
|
2022-05-06 12:12:01 +00:00
|
|
|
|
|
|
|
## Podman
|
|
|
|
set -l sagemath_image docker.io/sagemath/sagemath:latest
|
|
|
|
abbr -a -g sage "podman pull $sagemath_image; podman run -it --rm $sagemath_image"
|
|
|
|
abbr -a -g sage-jupyter "podman pull $sagemath_image; podman run -it --rm -p8888:8888 $sagemath_image sage-jupyter"
|
|
|
|
|
2022-05-14 00:14:13 +00:00
|
|
|
set -l fedora_image registry.fedoraproject.org/fedora:(rpm -E %fedora)
|
2022-05-06 12:12:01 +00:00
|
|
|
abbr -a -g fedora "podman pull $fedora_image; podman run -it --rm $fedora_image"
|
|
|
|
|
|
|
|
set -l asciidoctor_image docker.io/asciidoctor/docker-asciidoctor:latest
|
|
|
|
abbr -a -g adoc "podman pull $asciidoctor_image; podman run -it --rm -v (pwd):/documents/:Z $asciidoctor_image"
|
|
|
|
|
|
|
|
# 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-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
|