mirror of
https://github.com/oh-my-fish/oh-my-fish
synced 2024-11-03 15:40:32 +00:00
Merge pull request #320 from tobias-johansson/master
Enable peco plugin to take current commandline as query
This commit is contained in:
commit
05b428ed65
@ -1,9 +0,0 @@
|
|||||||
Based directly on the percol plugin.
|
|
||||||
|
|
||||||
Please bind peco_select_history in your favorite key.
|
|
||||||
|
|
||||||
If you'd like to bind CTRL+R
|
|
||||||
|
|
||||||
function fish_user_key_bindings
|
|
||||||
bind \cr peco_select_history
|
|
||||||
end
|
|
13
plugins/peco/README.md
Normal file
13
plugins/peco/README.md
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
peco
|
||||||
|
----
|
||||||
|
|
||||||
|
Based directly on the percol plugin.
|
||||||
|
|
||||||
|
Please bind peco_select_history to your favorite key.
|
||||||
|
|
||||||
|
If you'd like to bind CTRL+R
|
||||||
|
```
|
||||||
|
function fish_user_key_bindings
|
||||||
|
bind \cr 'peco_select_history (commandline -b)'
|
||||||
|
end
|
||||||
|
```
|
@ -1,5 +1,12 @@
|
|||||||
function peco_select_history
|
function peco_select_history
|
||||||
history|peco|read foo
|
if test (count $argv) = 0
|
||||||
|
set peco_flags --layout=bottom-up
|
||||||
|
else
|
||||||
|
set peco_flags --layout=bottom-up --query "$argv"
|
||||||
|
end
|
||||||
|
|
||||||
|
history|peco $peco_flags|read foo
|
||||||
|
|
||||||
if [ $foo ]
|
if [ $foo ]
|
||||||
commandline $foo
|
commandline $foo
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user