nu: Add space prefix to keybind commands to prevent history adding
To prevent adding any of the keyboard-binding driven commands to the user's command history, we simply prefix all of them with a single space.
This commit is contained in:
parent
b305be8ad0
commit
bfecbdcd59
1 changed files with 5 additions and 4 deletions
|
|
@ -82,7 +82,7 @@ $env.config.keybindings = [
|
|||
mode: [emacs vi_insert vi_normal]
|
||||
event: {
|
||||
send: ExecuteHostCommand
|
||||
cmd: "let cmd = (commandline); commandline edit (if $cmd starts-with sudo { $cmd | str replace -r '^sudo ' '' } else { 'sudo ' ++ $cmd });"
|
||||
cmd: " let cmd = (commandline); commandline edit (if $cmd starts-with sudo { $cmd | str replace -r '^sudo ' '' } else { 'sudo ' ++ $cmd });"
|
||||
}
|
||||
}
|
||||
{
|
||||
|
|
@ -105,7 +105,7 @@ $env.config.keybindings = [
|
|||
mode: ["emacs", "vi_normal", "vi_insert"]
|
||||
event: {
|
||||
send: executehostcommand
|
||||
cmd: "zoxide query --interactive"
|
||||
cmd: " zoxide query --interactive"
|
||||
}
|
||||
}
|
||||
{
|
||||
|
|
@ -115,7 +115,7 @@ $env.config.keybindings = [
|
|||
mode: [ "vi_normal"]
|
||||
event: {
|
||||
send: executehostcommand
|
||||
cmd: "zoxide query --interactive"
|
||||
cmd: " zoxide query --interactive"
|
||||
}
|
||||
}
|
||||
{
|
||||
|
|
@ -125,6 +125,7 @@ $env.config.keybindings = [
|
|||
mode: ["emacs", "vi_normal", "vi_insert"]
|
||||
event: {
|
||||
send: executehostcommand
|
||||
# intentional eol space to prevent adding cmd to history
|
||||
cmd: "
|
||||
let fzf_ctrl_t_command = \$\"fd --type file --hidden | fzf --preview 'bat --color=always --style=full --line-range=:500 {}' \";
|
||||
let result = nu -l -i -c $fzf_ctrl_t_command;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue