-
Notifications
You must be signed in to change notification settings - Fork 36
/
gallery.sh
27 lines (20 loc) · 1.03 KB
/
gallery.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# irm: Selects files to delete from current folder (recommended to use trash instead of rm -rf)
alias irm="ls | ipt -m | xargs rm -rf"
# irebase: Interactive build a list of git commits from log and rebase from selected one
alias irebase="git --no-pager log --oneline | ipt | cut -d ' ' -f 1 | xargs -o git rebase -i"
# icheckout: Interactive git checkout a commit, similar to irebase
alias icheckout="git --no-pager log --oneline | ipt | cut -d ' ' -f 1 | xargs git checkout"
# iseek: Interactive browse folders, ctrl+c once you're done
function iseek() {
cd "$(ls -a -d */ .. | ipt)"
iseek
}
# iadd: Interactive staging of selected changed files (faster than git add --patch)
alias iadd='git status -s | sed s/^...// | ipt -m | xargs git add'
# Choose one git stash to show.
alias ishow="git stash list | ipt --unquoted | cut -d ':' -f 1 | xargs git stash show -u"
# ibrew: Interactive browse Homebrew search result and choose what to install
# Example: ibrew nvm
function ibrew() {
brew search "$@" | ipt | xargs brew install
}