mirror of
https://github.com/junegunn/fzf.git
synced 2025-11-18 16:45:38 -05:00
Commandline: Add fzf-select
@@ -28,6 +28,19 @@ function fzf-cdhist-widget -d 'cd to one of the previously visited location'
|
|||||||
end
|
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
|
### Git
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|||||||
Reference in New Issue
Block a user