From 09548ce411f213e5cc62534419d30a5d62e36c1d Mon Sep 17 00:00:00 2001 From: Charles Gould Date: Thu, 21 May 2020 23:38:14 -0500 Subject: [PATCH] git: move aliases to fish abbreviations --- fish/conf.d/abbr.fish | 21 +++++++++++++++++++++ fish/config.fish | 5 ----- git/config | 22 +--------------------- 3 files changed, 22 insertions(+), 26 deletions(-) create mode 100644 fish/conf.d/abbr.fish diff --git a/fish/conf.d/abbr.fish b/fish/conf.d/abbr.fish new file mode 100644 index 0000000..4b99366 --- /dev/null +++ b/fish/conf.d/abbr.fish @@ -0,0 +1,21 @@ +if status --is-interactive + abbr -a -g d 'docker' + abbr -a -g vi 'nvim' + abbr -a -g vim 'nvim' + + abbr -a -g g 'git' + abbr -a -g ga 'git add' + abbr -a -g gb 'git branchsort' + abbr -a -g gbd 'git branch -D' + abbr -a -g gc 'git commit' + abbr -a -g gco 'git checkout' + abbr -a -g gcp 'git cherry-pick' + abbr -a -g gd 'git diff' + abbr -a -g gdc 'git diff --cached' + abbr -a -g gdh 'git diff --cached HEAD~' + abbr -a -g gl 'git log --oneline -10' + abbr -a -g gr 'git restore' + abbr -a -g gs 'git status' + abbr -a -g gst 'git stash' + abbr -a -g gsw 'git switch' +end diff --git a/fish/config.fish b/fish/config.fish index e7b9604..a9a9e07 100644 --- a/fish/config.fish +++ b/fish/config.fish @@ -47,11 +47,6 @@ set -x LESS_TERMCAP_so (set_color -b blue black) set -x LESS_TERMCAP_ue (set_color normal) set -x LESS_TERMCAP_us (set_color brgreen) -# Abbreviations -abbr -a -g d docker -abbr -a -g vi nvim -abbr -a -g vim nvim - # Aliases alias which='type --all --short' function ..; cd ..; end diff --git a/git/config b/git/config index 5787907..188049a 100644 --- a/git/config +++ b/git/config @@ -7,30 +7,10 @@ pager = diff-so-fancy | less --tabs=4 -RFX [alias] aliases = config --get-regexp alias - br = branch --sort='-committerdate' --format='%(HEAD) %(color:blue)%(committerdate:short)%(color:reset) - %(if)%(worktreepath)%(then)%(color:reverse yellow)%(refname:short)%(color:reset)%(else)%(color:yellow)%(refname:short)%(color:reset)%(end)' - co = checkout - df = diff - dc = diff --cached - dch = diff --cached HEAD~ - lol = log --oneline --max-count=10 --decorate=no - ss = status --short - st = status --long - sw = switch - cp = cherry-pick - f = fetch --all --prune - pl = pull - ps = push - pu = push --set-upstream - pf = push --force - cm = commit -m - cv = commit -v - ca = commit --amend + branchsort = branch --sort='-committerdate' --format='%(HEAD) %(color:blue)%(committerdate:short)%(color:reset) - %(if)%(worktreepath)%(then)%(color:reverse yellow)%(refname:short)%(color:reset)%(else)%(color:yellow)%(refname:short)%(color:reset)%(end)' can = commit --amend --no-edit cand = commit --amend --no-edit --date=now rbi = rebase --interactive - re = restore - res = restore --staged - ress = restore --staged --worktree --source=HEAD [color] ui = auto [color "branch"]