Skip to content
Myr

Add `fe` command to examples section as suggested in #27

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Junegunn Choi · committed by Junegunn Choi · parent 0a8352a · Browse files · 1 file+23 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+23 added−0 removed

  • other:+23 added−0 removed

1 file+23 added−0 removed

modified:README.md+23 added
174 unmodified lines
175 commits=$(git log --pretty=oneline --abbrev-commit) &&176 commit=$(echo "$commits" | fzf +s +m -e) &&177 git checkout $(echo "$commit" | sed "s/ .*//")178}179180# fq1 [QUERY]181# - Immediately select the file when there's only one match.182# If not, start the fuzzy finder as usual.183fq1() {184 local lines185 lines=$(fzf --filter="$1" --no-sort)186 if [ -z "$lines" ]; then187 return 1188 elif [ $(wc -l <<< "$lines") -eq 1 ]; then189 echo "$lines"190 else191 echo "$lines" | fzf --query="$1"192 fi193}194195# fe [QUERY]196# - Open the selected file with the default editor197# (Bypass fuzzy finder when there's only one match)198fe() {199 local file200 file=$(fq1 "$1") && ${EDITOR:-vim} "$file"201}202```203204Key bindings for command line205-----------------------------
164 unmodified lines