|
|
|
@ -173,12 +173,6 @@ fd() {
|
|
|
|
|
cd "$dir"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# fda - including hidden directories
|
|
|
|
|
fda() {
|
|
|
|
|
local dir
|
|
|
|
|
dir=$(find ${1:-.} -type d 2> /dev/null | fzf +m) && cd "$dir"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# fh - repeat history
|
|
|
|
|
fh() {
|
|
|
|
|
eval $(([ -n "$ZSH_NAME" ] && fc -l 1 || history) | fzf +s | sed 's/ *[0-9]* *//')
|
|
|
|
@ -188,33 +182,6 @@ fh() {
|
|
|
|
|
fkill() {
|
|
|
|
|
ps -ef | sed 1d | fzf -m | awk '{print $2}' | xargs kill -${1:-9}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# fbr - checkout git branch
|
|
|
|
|
fbr() {
|
|
|
|
|
local branches branch
|
|
|
|
|
branches=$(git branch) &&
|
|
|
|
|
branch=$(echo "$branches" | fzf +s +m) &&
|
|
|
|
|
git checkout $(echo "$branch" | sed "s/.* //")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# fco - checkout git commit
|
|
|
|
|
fco() {
|
|
|
|
|
local commits commit
|
|
|
|
|
commits=$(git log --pretty=oneline --abbrev-commit --reverse) &&
|
|
|
|
|
commit=$(echo "$commits" | fzf +s +m -e) &&
|
|
|
|
|
git checkout $(echo "$commit" | sed "s/ .*//")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# ftags - search ctags
|
|
|
|
|
ftags() {
|
|
|
|
|
local line
|
|
|
|
|
[ -e tags ] &&
|
|
|
|
|
line=$(
|
|
|
|
|
awk 'BEGIN { FS="\t" } !/^!/ {print toupper($4)"\t"$1"\t"$2"\t"$3}' tags |
|
|
|
|
|
cut -c1-80 | fzf --nth=1,2
|
|
|
|
|
) && $EDITOR $(cut -f3 <<< "$line") -c "set nocst" \
|
|
|
|
|
-c "silent tag $(cut -f2 <<< "$line")"
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
For more examples, see [the wiki
|
|
|
|
|