mirror of
https://github.com/junegunn/fzf.git
synced 2025-11-18 08:13:40 -05:00
Updated Examples (markdown)
41
Examples.md
41
Examples.md
@@ -56,17 +56,6 @@ cdf() {
|
||||
file=$(fzf +m -q "$1") && dir=$(dirname "$file") && cd "$dir"
|
||||
}
|
||||
```
|
||||
### Changing directory with fasd
|
||||
|
||||
Suggested by [@l4u](https://github.com/l4u):
|
||||
|
||||
```sh
|
||||
# fj - changing directory with fasd
|
||||
fj() {
|
||||
local dir
|
||||
dir=$(fasd -Rdl | fzf --no-sort +m) && cd "$dir"
|
||||
}
|
||||
```
|
||||
|
||||
### Searching file contents
|
||||
|
||||
@@ -348,7 +337,8 @@ ftpane () {
|
||||
```
|
||||
|
||||
### v
|
||||
Inspired by [v](https://github.com/rupa/v). Opens files in ~/.viminfo
|
||||
|
||||
#### Inspired by [v](https://github.com/rupa/v). Opens files in ~/.viminfo
|
||||
|
||||
```sh
|
||||
# v - open files in ~/.viminfo
|
||||
@@ -361,10 +351,22 @@ v() {
|
||||
}
|
||||
```
|
||||
|
||||
#### With [fasd](https://github.com/clvv/fasd).
|
||||
|
||||
Suggested by [@epiloque](https://github.com/epiloque)
|
||||
|
||||
```sh
|
||||
v() {
|
||||
local file
|
||||
file="$(fasd -Rfl "$1" | fzf -1 -0 --no-sort +m)" && vi "${file}" || return 1
|
||||
}
|
||||
```
|
||||
|
||||
### z
|
||||
|
||||
Integration with [z](https://github.com/rupa/z), like normal z when used with
|
||||
arguments but displays an fzf prompt when used without.
|
||||
#### Integration with [z](https://github.com/rupa/z).
|
||||
|
||||
like normal z when used with arguments but displays an fzf prompt when used without.
|
||||
|
||||
```sh
|
||||
unalias z 2> /dev/null
|
||||
@@ -403,6 +405,17 @@ alias j=z
|
||||
alias jj=zz
|
||||
```
|
||||
|
||||
#### With [fasd](https://github.com/clvv/fasd).
|
||||
|
||||
Suggested by [@l4u](https://github.com/l4u) and [@epiloque](https://github.com/epiloque)
|
||||
|
||||
```sh
|
||||
z() {
|
||||
local dir
|
||||
dir="$(fasd -Rdl "$1" | fzf -1 -0 --no-sort +m)" && cd "${dir}" || return 1
|
||||
}
|
||||
```
|
||||
|
||||
### Shell bookmarks
|
||||
|
||||
Yet another useful application for `fzf`: shell bookmarks. It looks as follows:
|
||||
|
||||
Reference in New Issue
Block a user