Fzf history in nushell
This commit is contained in:
parent
bf10f9ad67
commit
7a323e9e48
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue