mirror of
https://github.com/junegunn/fzf.git
synced 2025-11-18 16:45:38 -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"
|
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
|
### Searching file contents
|
||||||
|
|
||||||
@@ -348,7 +337,8 @@ ftpane () {
|
|||||||
```
|
```
|
||||||
|
|
||||||
### v
|
### 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
|
```sh
|
||||||
# v - open files in ~/.viminfo
|
# 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
|
### z
|
||||||
|
|
||||||
Integration with [z](https://github.com/rupa/z), like normal z when used with
|
#### Integration with [z](https://github.com/rupa/z).
|
||||||
arguments but displays an fzf prompt when used without.
|
|
||||||
|
like normal z when used with arguments but displays an fzf prompt when used without.
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
unalias z 2> /dev/null
|
unalias z 2> /dev/null
|
||||||
@@ -403,6 +405,17 @@ alias j=z
|
|||||||
alias jj=zz
|
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
|
### Shell bookmarks
|
||||||
|
|
||||||
Yet another useful application for `fzf`: shell bookmarks. It looks as follows:
|
Yet another useful application for `fzf`: shell bookmarks. It looks as follows:
|
||||||
|
|||||||
Reference in New Issue
Block a user