mirror of
https://github.com/junegunn/fzf.git
synced 2025-11-20 17:43:42 -05:00
Updated examples (markdown)
18
examples.md
18
examples.md
@@ -139,6 +139,22 @@ fs() {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
z
|
||||||
|
-
|
||||||
|
|
||||||
|
Integration with [z](https://github.com/rupa/z), like normal z when used with
|
||||||
|
arguments but displays an fzf prompt when used without.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
z() {
|
||||||
|
if [[ -z "$*" ]]; then
|
||||||
|
cd "$(_z -l 2>&1 | sed -n 's/^[ 0-9.,]*//p' | fzf)"
|
||||||
|
else
|
||||||
|
local reporoot="$(command git rev-parse --show-toplevel 2> /dev/null)"
|
||||||
|
_z $reporoot "$@"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
Vim scripts
|
Vim scripts
|
||||||
===========
|
===========
|
||||||
@@ -159,7 +175,7 @@ command! -nargs=1 AgFZF call fzf#run({
|
|||||||
function! AgHandler(l)
|
function! AgHandler(l)
|
||||||
let keys = split(a:l,':')
|
let keys = split(a:l,':')
|
||||||
execute 'tabe +' . keys[-2] . ' ' . escape(keys[-1], ' ')
|
execute 'tabe +' . keys[-2] . ' ' . escape(keys[-1], ' ')
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! Arghandler(l)
|
function! Arghandler(l)
|
||||||
return "ag -i " . a:l . " | sed 's@\\(.[^:]*\\):\\(.[^:]*\\):\\(.*\\)@\\3:\\2:\\1@' "
|
return "ag -i " . a:l . " | sed 's@\\(.[^:]*\\):\\(.[^:]*\\):\\(.*\\)@\\3:\\2:\\1@' "
|
||||||
|
|||||||
Reference in New Issue
Block a user