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-05-14 02:14:13 +02:00

117 lines
2.7 KiB
Fish

if status is-interactive
# Disable greeting
set -g fish_greeting
# Vi mode
fish_vi_key_bindings
set fish_cursor_default block blink
set fish_cursor_insert line blink
set fish_cursor_replace_one underscore blink
set fish_cursor_visual block blink
# 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
abbr -a -g rsync "rsync -ravhL --partial --zc=zstd --zl=22 --no-i-r --info=progress2,stats2"
## 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"
set -l fedora_image registry.fedoraproject.org/fedora:(rpm -E %fedora)
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"
# ENV variables
set -x EDITOR /usr/bin/nvim
set -x JULIA_NUM_THREADS 16
# Setup
## Zoxide
zoxide init fish | source
## starship
starship init fish | source
# 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 onefetch -w onefetch
onefetch --no-palette $argv
end
function gn
/home/mo/bin/goneovim/goneovim --maximized $argv &>/dev/null &
disown
end
function build_sh
podman start build
podman exec -it build bash
podman stop -t 0 build
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