nushell fzf history search
This commit is contained in:
+26
-5
@@ -15,18 +15,39 @@ $env.config = {
|
||||
}
|
||||
keybindings: [
|
||||
{
|
||||
name: history_menu
|
||||
name: fuzzy_history_fzf
|
||||
modifier: control
|
||||
keycode: char_r
|
||||
mode: [ emacs, vi_insert, vi_normal ]
|
||||
event: { send: menu name: history_menu }
|
||||
mode: [emacs, vi_normal, vi_insert]
|
||||
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
|
||||
keycode: char_/
|
||||
mode: [ vi_normal ]
|
||||
event: { send: menu name: history_menu }
|
||||
event: { send: menu name: fuzzy_history_fzf }
|
||||
}
|
||||
{
|
||||
name: clear_everything
|
||||
|
||||
Reference in New Issue
Block a user