m/fzf
1
0
mirror of https://github.com/junegunn/fzf.git synced 2025-11-20 17:43:42 -05:00

Updated examples (markdown)

Junegunn Choi
2014-05-02 07:45:28 -07:00
parent 76011c0010
commit 5f48daf97b

@@ -3,8 +3,8 @@ Useful examples
Feel free to edit this page if you have a nice example of using fzf.
Opening files and directories
-----------------------------
Opening files
-------------
```sh
# fe [FUZZY PATTERN] - Open the selected file with the default editor
@@ -17,6 +17,9 @@ fe() {
}
```
Changing directory
------------------
```sh
# fd - cd to selected directory
fd() {
@@ -35,6 +38,17 @@ fda() {
}
```
Suggested by @harelba and @dimonomid:
```sh
# cdf - cd into the directory of the selected file
cdf() {
local file
local dir
file=$(fzf +m -q "$1") && dir=$(dirname "$file") && cd "$dir"
}
```
Command history
---------------