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]
|
mode: [emacs vi_insert vi_normal]
|
||||||
event: {
|
event: {
|
||||||
send: ExecuteHostCommand
|
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"]
|
mode: ["emacs", "vi_normal", "vi_insert"]
|
||||||
event: {
|
event: {
|
||||||
send: executehostcommand
|
send: executehostcommand
|
||||||
cmd: "zoxide query --interactive"
|
cmd: " zoxide query --interactive"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
|
|
@ -115,7 +115,7 @@ $env.config.keybindings = [
|
||||||
mode: [ "vi_normal"]
|
mode: [ "vi_normal"]
|
||||||
event: {
|
event: {
|
||||||
send: executehostcommand
|
send: executehostcommand
|
||||||
cmd: "zoxide query --interactive"
|
cmd: " zoxide query --interactive"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
|
|
@ -125,7 +125,8 @@ $env.config.keybindings = [
|
||||||
mode: ["emacs", "vi_normal", "vi_insert"]
|
mode: ["emacs", "vi_normal", "vi_insert"]
|
||||||
event: {
|
event: {
|
||||||
send: executehostcommand
|
send: executehostcommand
|
||||||
cmd: "
|
# 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 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;
|
let result = nu -l -i -c $fzf_ctrl_t_command;
|
||||||
commandline edit --append $result;
|
commandline edit --append $result;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue