mirror of
https://github.com/Llewellynvdm/fzf.git
synced 2025-01-10 18:24:39 +00:00
parent
d76a3646b7
commit
9dac12cb32
33
README.md
33
README.md
@ -173,12 +173,6 @@ fd() {
|
|||||||
cd "$dir"
|
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 - repeat history
|
||||||
fh() {
|
fh() {
|
||||||
eval $(([ -n "$ZSH_NAME" ] && fc -l 1 || history) | fzf +s | sed 's/ *[0-9]* *//')
|
eval $(([ -n "$ZSH_NAME" ] && fc -l 1 || history) | fzf +s | sed 's/ *[0-9]* *//')
|
||||||
@ -188,33 +182,6 @@ fh() {
|
|||||||
fkill() {
|
fkill() {
|
||||||
ps -ef | sed 1d | fzf -m | awk '{print $2}' | xargs kill -${1:-9}
|
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
|
For more examples, see [the wiki
|
||||||
|
Loading…
Reference in New Issue
Block a user