Skip to content

Instantly share code, notes, and snippets.

@reanimat0r
Forked from kenchou/abbr.fish
Created November 8, 2025 05:40
Show Gist options
  • Select an option

  • Save reanimat0r/50024390fe1c67bf0d8933b7a856bf99 to your computer and use it in GitHub Desktop.

Select an option

Save reanimat0r/50024390fe1c67bf0d8933b7a856bf99 to your computer and use it in GitHub Desktop.
fish abbr
# 注:fish v3.6.0+ abbr 不再设置为 Universal
# 升级 fish 注意需清除 $__fish_config_dir/fish_variables (一般为 ~/.config/fish/fish_variables) 中旧的变量
# (MacOS) application
abbr android 'open -a Android\ Studio'
abbr anki 'open -a anki'
abbr boop 'open -a boop'
abbr ff 'open -a firefox'
abbr filezilla 'open -a filezilla'
abbr haroopad 'open -a haroopad'
abbr office 'open -a libreoffice'
abbr openscad 'open -a openscad'
abbr phpstorm 'open -a phpstorm'
abbr picard 'open -a MusicBrainz\ Picard'
abbr pycharm 'open -a pycharm'
abbr vsc 'open -a visual\ studio\ code'
# git command
abbr ga 'git add'
abbr gs 'git status'
abbr git-bc 'git branch | grep -v "^*" | xargs git branch -d'
abbr git-br 'git for-each-ref --sort=committerdate refs/heads/ --format="%(HEAD) %(color:yellow)%(refname:short)%(color:reset) [%(color:cyan)%(objectname:short)%(color:reset)] - %(contents:subject) - %(authorname) (%(color:green)%(committerdate:relative)%(color:reset))"'
abbr git-brr 'git for-each-ref --sort=committerdate refs/remotes/origin/ --format="%(HEAD) %(color:yellow)%(refname:short)%(color:reset) [%(color:cyan)%(objectname:short)%(color:reset)] - %(contents:subject) - %(authorname) (%(color:green)%(committerdate:relative)%(color:reset))"'
abbr git-mc 'git submodule foreach "git remote prune origin; git reset --hard; git clean -df; git fetch"'
# utils command
abbr --set-cursor -- agi 'ag --ignore \'%\''
abbr brew-independ 'for f in (brew list --formula); if not string length -q -- (brew uses --installed $f); echo $f; end; end'
abbr brew-outdated 'brew update; echo "--- formula ---"; brew outdated --formula; echo "--- cask ---"; brew outdated --cask'
abbr btinfo 'for f in *.torrent; show-torrent-info $f | jq -r "\"$f\" + \" : \" + .info.name"; end'
abbr gi-update 'cp ~/.gitignore_custom ~/.gitignore_global; for k in linux,macos,windows fish,zsh cvs,git libreoffice eclipse,jetbrains,visualstudiocode,xcode go,java,node,python,ruby,composer,gradle,yarn; gi $k; end >> ~/.gitignore_global'
abbr lsns 'scutil --dns | grep nameserver'
abbr lsport 'lsof -Pn -sTCP:LISTEN -iTCP'
abbr mzfc 'composer mezzio factory:create'
abbr pjo 'pj open'
abbr pyenv-install 'CFLAGS="-I"(xcrun --show-sdk-path)"/usr/include" LDFLAGS="-L"(brew --prefix zlib)"/lib" PYTHON_CONFIGURE_OPTS="--enable-framework" pyenv install'
abbr scp2home 'scp -oProxyJump=home'
abbr scp3 'scp -oProxyJump='
abbr sort-skip-head 'awk \'NR<2{print;next}{print|"sort -g"}\''
abbr sqlite litecli
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment