diff --git a/home-manager/modules/programs/nushell/config.nu b/home-manager/modules/programs/nushell/config.nu index 08ea56d..9720e32 100644 --- a/home-manager/modules/programs/nushell/config.nu +++ b/home-manager/modules/programs/nushell/config.nu @@ -424,13 +424,44 @@ $env.config = { ] } } - { - name: history_menu - modifier: control - keycode: char_r - mode: [emacs, vi_insert, vi_normal] - event: { send: menu name: history_menu } - } + # { + # name: history_menu + # modifier: control + # keycode: char_r + # mode: [emacs, vi_insert, vi_normal] + # event: { send: menu name: history_menu } + # } + { + name: fuzzy_history + modifier: control + keycode: char_r + mode: [emacs, vi_normal, vi_insert] + event: [ + { + send: ExecuteHostCommand + cmd: "do { + $env.SHELL = (which bash) + commandline edit --insert ( + history + | get command + | reverse + | uniq + | str join (char -i 0) + | fzf --scheme=history + --read0 + --layout=reverse + --height=40% + --bind 'ctrl-/:change-preview-window(right,70%|right)' + --preview='echo -n {} | nu --stdin -c \'nu-highlight\'' + # Run without existing commandline query for now to test composability + # -q (commandline) + | decode utf-8 + | str trim + ) + }" + } + ] + } { name: help_menu modifier: none