Last active
October 10, 2024 16:24
-
-
Save juliavdkris/e3bda6fece354956caf637a8e4a78cc5 to your computer and use it in GitHub Desktop.
Fish config (aliases n some other shit)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Text editor | |
abbr -a -g m micro | |
alias hex='hx' | |
abbr -a -g hx helix | |
abbr -a -g v nvim | |
export EDITOR=helix | |
export BROWSER=firefox | |
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 gitch git checkout | |
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='helix ~/.config/fish/config.fish && source ~/.config/fish/config.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 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 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 | |
alias newenv='python3 -m venv .venv && penv && .venv/bin/python3 -m pip install --upgrade pip && if test -e requirements.txt; .venv/bin/python3 -m pip install -r requirements.txt; end; #' | |
alias penv='source .venv/bin/activate.fish' | |
# Fun stuff | |
alias fucking=sudo | |
alias please=sudo | |
alias amai=sudo | |
alias wollah=sudo | |
alias kurwa=fuck | |
alias blyat=fuck | |
alias scheisse=fuck | |
alias damn=fuck | |
alias dammit=fuck | |
alias shit=fuck | |
alias ffs=fuck | |
# Use trash-cli instead of permanently removing a file | |
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 | |
# Colorful less | |
set -xU LESS_TERMCAP_md (printf "\e[01;31m") | |
set -xU LESS_TERMCAP_me (printf "\e[0m") | |
set -xU LESS_TERMCAP_se (printf "\e[0m") | |
#set -xU LESS_TERMCAP_so (printf "\e[01;44;33m") | |
set -xU LESS_TERMCAP_ue (printf "\e[0m") | |
set -xU 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 | |
# Kinda cool, but slow as fuck (try `time fish .config/fish/config.fish`) | |
#thefuck --alias | source | |
# 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 | |
#if status is-login | |
# contains ~/.cargo/bin ~/.local/bin ~/go/bin $PATH | |
# or set PATH ~/.cargo/bin ~/.local/bin ~/go/bin $PATH | |
#end | |
function l | |
src-hilite-lesspipe.sh $argv[1] | less | |
end | |
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 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 | |
function gasm | |
gcc -no-pie -g -o $argv[1] $argv[1].s | |
end | |
function wgasm | |
echo $argv[1].s | entr fish -c " | |
clear && | |
gcc -no-pie -g -o $argv[1] $argv[1].s && | |
echo Compiled! | |
" | |
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