nushell fzf history search
This commit is contained in:
+26
-5
@@ -15,18 +15,39 @@ $env.config = {
|
|||||||
}
|
}
|
||||||
keybindings: [
|
keybindings: [
|
||||||
{
|
{
|
||||||
name: history_menu
|
name: fuzzy_history_fzf
|
||||||
modifier: control
|
modifier: control
|
||||||
keycode: char_r
|
keycode: char_r
|
||||||
mode: [ emacs, vi_insert, vi_normal ]
|
mode: [emacs, vi_normal, vi_insert]
|
||||||
event: { send: menu name: history_menu }
|
event: {
|
||||||
|
send: ExecuteHostCommand
|
||||||
|
cmd: "commandline edit --insert (
|
||||||
|
history
|
||||||
|
| where exit_status == 0
|
||||||
|
| get command
|
||||||
|
| reverse
|
||||||
|
| uniq
|
||||||
|
| str join (char -i 0)
|
||||||
|
| fzf
|
||||||
|
--preview '{}'
|
||||||
|
--preview-window 'bottom:3:wrap'
|
||||||
|
--scheme history
|
||||||
|
--read0
|
||||||
|
--layout reverse
|
||||||
|
--bind alt-up:preview-up,alt-down:preview-down
|
||||||
|
--height 70%
|
||||||
|
--query (commandline)
|
||||||
|
| decode utf-8
|
||||||
|
| str trim
|
||||||
|
)"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
name: history_menu
|
name: fuzzy_history_fzf
|
||||||
modifier: none
|
modifier: none
|
||||||
keycode: char_/
|
keycode: char_/
|
||||||
mode: [ vi_normal ]
|
mode: [ vi_normal ]
|
||||||
event: { send: menu name: history_menu }
|
event: { send: menu name: fuzzy_history_fzf }
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
name: clear_everything
|
name: clear_everything
|
||||||
|
|||||||
Reference in New Issue
Block a user