Skip to content

Instantly share code, notes, and snippets.

@reanimat0r
Forked from juliavdkris/config.fish
Created November 8, 2025 05:20
Show Gist options
  • Select an option

  • Save reanimat0r/2ef52982e616b7726185611e4c888f12 to your computer and use it in GitHub Desktop.

Select an option

Save reanimat0r/2ef52982e616b7726185611e4c888f12 to your computer and use it in GitHub Desktop.
Fish config (aliases n some other shit)
# Text editor
abbr -a -g m micro
alias hex='hx'
abbr -a -g hx helix
abbr -a -g v nvim
export EDITOR=nvim
export MANPAGER='nvim +Man!'
export BROWSER=librewolf
export NNN_PLUG='z:autojump;f:finder;o:fzopen;d:diffs'
# Fancy colors
alias less='less -RM'
alias ip='ip -c'
alias tree='tree -C | less'
alias neofetch='hyfetch'
alias ls='eza'
alias lla='eza -lah'
abbr -a -g ps procs
abbr -a -g httpie xh
# Git shortcuts
alias gitpruneremote='git branch -a --merged | choose -f \'remotes/origin/\' 1: | rg -v \'(^master$)|HEAD\' | xargs -p -I _ git push origin :_'
alias gitvis='git log --graph --all --color --oneline'
alias gg='git-graph --color always | sponge | less' # https://github.com/mlange-42/git-graph
abbr -a -g g git
abbr -a -g igitt git-igitt # https://github.com/mlange-42/git-igitt
abbr -a -g gits git status
abbr -a -g gita git add .
abbr -a -g gitc git commit
abbr -a -g gitcl git clone
abbr -a -g gitsw git switch
abbr -a -g gitch git switch
abbr -a -g gitl git log
alias gitlf='git log --pretty=fancyoneline --date=relative'
abbr -a -g gitln git log -n
abbr -a -g gitb git branch -vv
abbr -a -g gitba git branch -vva
abbr -a -g gitd git diff
abbr -a -g gitdt git difftool
abbr -a -g gitds git diffsplit
abbr -a -g gitdh git diff HEAD
abbr -a -g gitdm git diff \(git merge-base main HEAD\) HEAD
abbr -a -g gitp git push
abbr -a -g gitpf git push --force-with-lease
abbr -a -g gitpl git pull
abbr -a -g gitr git restore
abbr -a -g gitrs git restore --staged
abbr -a -g gitrb git rebase
abbr -a -g gitf git fetch
abbr -a -g gitfp git fetch -p
abbr -a -g gl glab
# Ease of use aliases
alias fishconfig='nvim ~/.config/fish/config.fish && exec fish'
alias clearhistory='cat /dev/null > ~/.local/share/fish/fish_history'
alias cw=fish_clipboard_copy
alias cr=fish_clipboard_paste
abbr -a -g refreshmirrorlist sudo reflector --sort rate --score 100 --fastest 50 --connection-timeout 1 --download-timeout 1 -c netherlands,belgium,germany -p https --save /etc/pacman.d/mirrorlist --verbose
abbr -a -g jour journalctl -fxeu
abbr -a -g jouru journalctl --user -fxeu
abbr -a -g pm podman
abbr -a -g py python
abbr -a -g p pnpm
abbr -a -g pr pnpm run
abbr -a -g pd pnpm dev
abbr -a -g b bun
abbr -a -g bd bun dev
abbr -a -g ipy ipython
abbr -a -g dc docker-compose
abbr -a -g pmc podman-compose
abbr -a -g rz rizin
abbr -a -g r2 rizin
abbr -a -g calc kalker
abbr -a -g e echo
alias pacdiff='sudo DIFFPROG="delta" pacdiff'
abbr -a -g irc tiny
abbr -a -g pdfgrep rga
abbr -a -g superping mtr
abbr -a -g diskusage dua i
alias lolcat='dotacat'
abbr -a -g c code .
alias ytdl='yt-dlp'
abbr -a -g diff delta
alias server='miniserve . -c Archlinux'
abbr -a -g pyserver python3 -m http.server
abbr -a -g nmapfull nmap -sC -sV -oN nmap -T4 -v
abbr -a -g startdjango python manage.py runserver
# Rust
abbr -a -g cr cargo r
abbr -a -g cb cargo b
abbr -a -g cbr cargo b --release
abbr -a -g bacon bacon clippy -- -- -A dead_code -A unused_variables
abbr -a -g rdocs rustup doc
abbr -a -g rstd rustup doc --std
abbr -a -g rbook rustup doc --book
abbr -a -g rref rustup doc --reference
abbr -a -g rexample rustup doc --rust-by-example
abbr -a -g rman rusty-man
abbr -a -g rupdate 'rustup update && cargo install-update -a'
# Python
abbr -a -g pip uv pip
alias newenv='uv venv && penv && if test -e requirements.txt; uv pip install -r requirements.txt; end; #'
alias penv='source .venv/bin/activate.fish'
# Use trash-cli instead of permanently removing a file
# + other carefulness things
abbr -a -g rm trash -i
abbr -a -g rmm rm -i
abbr -a -g mv mv -iv
abbr -a -g cp cp -riv
abbr -a -g mkdir mkdir -vp
# Shell wrapper for yazi
function y
set tmp (mktemp -t "yazi-cwd.XXXXXX")
yazi $argv --cwd-file="$tmp"
if set cwd (command cat -- "$tmp"); and [ -n "$cwd" ]; and [ "$cwd" != "$PWD" ]
builtin cd -- "$cwd"
end
rm -f -- "$tmp"
end
# Colorful less
set -xg LESS_TERMCAP_md (printf "\e[01;31m")
set -xg LESS_TERMCAP_me (printf "\e[0m")
set -xg LESS_TERMCAP_se (printf "\e[0m")
#set -xg LESS_TERMCAP_so (printf "\e[01;44;33m")
set -xg LESS_TERMCAP_ue (printf "\e[0m")
set -xg LESS_TERMCAP_us (printf "\e[01;32m")
# Fancy Docker build logs
#set -xg DOCKER_BUILDKIT 1
set -xg DOCKER_HOST unix://$XDG_RUNTIME_DIR/podman/podman.sock
# Add local Rust and Python module binaries to path
set PATH ~/.cargo/bin ~/.local/bin ~/go/bin $PATH
set -xg PYTHONPATH $PYTHONPATH /home/julia/hackety_hack/binaryninja/python
function mkcd
mkdir $argv[1]
cd $argv[1]
end
function tldr
if [ "$argv" ]
command tldr $argv
else
command tldr --list | fzf --preview 'command tldr {} --color always' | xargs -r tldr
end
end
function spectrogram
for file in $argv
if test -f $file
sox $file -n spectrogram -t $file -x 2000 -o (path change-extension '' $file).png
else
echo "File not found: $file"
end
end
end
function b64
if test (count $argv) -eq 0
echo "Usage: b64 [d] <text>"
else if [ $argv[1] = "d" ]
echo -n "$argv[2..-1]" | base64 -d
else
echo -n "$argv" | base64 -w 0
end
end
function comprun
gcc -Wall -Werror -Wextra -Wpedantic -Wno-unused-parameter -Wno-unused-variable -std=c99 -g -o $argv[1] $argv[1].c && ./$argv[1]
end
# transfer.sh upload script
function transfer --description 'Upload a file to transfer.sh'
if [ $argv[1] ]
# write to output to tmpfile because of progress bar
set -l tmpfile ( mktemp -t transferXXX )
curl --progress-bar --upload-file $argv[1] https://transfer.sh/(basename $argv[1]) >> $tmpfile
echo >> $tmpfile
cat $tmpfile
command rm -f $tmpfile
else
echo 'usage: transfer FILE_TO_TRANSFER'
end
end
# tabtab, required for pnpm completions
[ -f ~/.config/tabtab/fish/__tabtab.fish ]; and . ~/.config/tabtab/fish/__tabtab.fish; or true
starship init fish | source
zoxide init fish | source
pyenv init - | source
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment