mirror of
https://github.com/junegunn/fzf.git
synced 2025-11-20 09:33:42 -05:00
Updated examples (markdown)
25
examples.md
25
examples.md
@@ -155,6 +155,31 @@ z() {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Here is another version that also supports relaunching z with the arguments
|
||||||
|
for the previous command as the default input by using zz
|
||||||
|
|
||||||
|
```sh
|
||||||
|
z() {
|
||||||
|
if [[ -z "$*" ]]; then
|
||||||
|
cd "$(_z -l 2>&1 | sed -n 's/^[ 0-9.,]*//p' | fzf)"
|
||||||
|
else
|
||||||
|
_last_z_args="$@"
|
||||||
|
_z "$@"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
zz() {
|
||||||
|
cd "$(_z -l 2>&1 | sed -n 's/^[ 0-9.,]*//p' | fzf -q $_last_z_args)"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
Since z is not very optimal located on a qwerty keyboard I have these aliased as j and jj
|
||||||
|
|
||||||
|
```sh
|
||||||
|
alias j=z
|
||||||
|
alias jj=zz
|
||||||
|
```
|
||||||
|
|
||||||
Vim scripts
|
Vim scripts
|
||||||
===========
|
===========
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user