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
2022-10-29 11:24:09 +02:00

109 lines
2.5 KiB
Fish

if status is-interactive
# Disable greeting
set -g fish_greeting
# Interactive environment variables
set -gx EDITOR ~/bin/nvim/bin/nvim
# Setup
## Zoxide
zoxide init fish | source
## Starship
starship init fish | source
## Atuin
set -gx ATUIN_NOBIND true
atuin init fish | source
bind \cr _atuin_search
# Abbreviations
## Replacements
abbr -ag rm trash
## Safety options
abbr -ag cp "cp -i"
abbr -ag mv "mv -i"
abbr -ag rmr "rm -r"
## Default options
set -g rsync "rsync -avhL --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
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"
set -l fedora_image registry.fedoraproject.org/fedora:(rpm -E %fedora)
abbr -ag fedora "podman run --pull newer -it --rm $fedora_image"
set -l asciidoctor_image docker.io/asciidoctor/docker-asciidoctor:latest
abbr -ag adoc "podman run --pull newer -it --rm -v (pwd):/documents/:Z $asciidoctor_image"
abbr -ag pps "podman ps --format '{{.Names}}'"
# Functions
## Replacements
function cd -w z
z $argv
end
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
function lg -w lazygit
lazygit $argv
end
function zola
flatpak run org.getzola.zola $argv
end
function julia
JULIA_NUM_THREADS=16 LD_PRELOAD=/usr/lib64/libstdc++.so.6 ~/bin/julia/bin/julia $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
# Private config
set -l private_config ~/.config/fish/private_config.fish
if test -f $private_config
source $private_config
end
end