m/fzf
1
0
mirror of https://github.com/junegunn/fzf.git synced 2025-11-18 08:13:40 -05:00

Commandline: Add fzf-select

Pierre Neidhardt
2016-12-13 15:36:43 +05:30
parent d020cf3a97
commit 5125bbdb54

@@ -28,6 +28,19 @@ function fzf-cdhist-widget -d 'cd to one of the previously visited location'
end
```
### Commandline
The following is useful to manipulate the commandline from the result of jobs. For instance, calling `fzf-select` over `pacman -Qlq fzf` will allow you to select files in the `fzf` package and print them bck to commandline for further manipulation.
```
function fzf-select -d 'fzf commandline job and print unescaped selection back to commandline'
set -l cmd (commandline -j)
[ "$cmd" ]; or return
eval $cmd | eval (__fzfcmd) -m --tiebreak=index --select-1 --exit-0 | string join ' ' | read -l result
[ "$result" ]; and commandline -j -- $result
commandline -f repaint
end
```
### Git
```