1
0
Fork 0
mirror of https://codeberg.org/Mo8it/dotfiles.git synced 2024-10-17 20:52:40 +00:00
dotfiles/.config/fish/config.fish

110 lines
2.6 KiB
Fish
Raw Normal View History

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_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
# Abbreviations
## Replacements
2022-08-14 00:57:34 +00:00
abbr -ag rm trash
## Safety options
2022-08-14 00:57:34 +00:00
abbr -ag cp "cp -i"
abbr -ag mv "mv -i"
abbr -ag rmi "rm -i"
## Default options
2022-08-14 00:57:34 +00:00
set -g rsync "rsync -ravhL --partial --zc=zstd --zl=8 --no-i-r --info=progress2"
abbr -ag rsync $rsync
abbr -ag onefetch "onefetch --no-palette"
## Podman
set -l sagemath_image docker.io/sagemath/sagemath:latest
2022-08-14 00:57:34 +00:00
abbr -ag sage "podman pull $sagemath_image; podman run -it --rm $sagemath_image"
abbr -ag 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-08-14 00:57:34 +00:00
abbr -ag fedora "podman pull $fedora_image; podman run -it --rm $fedora_image"
set -l asciidoctor_image docker.io/asciidoctor/docker-asciidoctor:latest
2022-08-14 00:57:34 +00:00
abbr -ag adoc "podman pull $asciidoctor_image; podman run -it --rm -v (pwd):/documents/:Z $asciidoctor_image"
abbr -ag pps "podman ps --format '{{.Names}}'"
# Functions
## Replacements
function cd -w z
z $argv
end
2022-05-10 16:23:15 +00:00
function kssh -w ssh
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
## 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
end