Customize ZSH history search in vi mode
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
I want to replace default history search widget in vi mode with my own (binding it the the default key, i.e. /
in command mode).
Here's what I tried putting in my .zshrc
:
custom_command()
history
zle -N custom_command
bindkey -M vicmd '/' custom_command
bindkey -M vicmd '^R' custom_command
With these bindings, pressing ctrl-R
does what I expect (displays history list), but hitting /
doesn't have any effect (I get the default history widget, not my custom_command
).
zsh command-history vi-mode
add a comment |Â
up vote
0
down vote
favorite
I want to replace default history search widget in vi mode with my own (binding it the the default key, i.e. /
in command mode).
Here's what I tried putting in my .zshrc
:
custom_command()
history
zle -N custom_command
bindkey -M vicmd '/' custom_command
bindkey -M vicmd '^R' custom_command
With these bindings, pressing ctrl-R
does what I expect (displays history list), but hitting /
doesn't have any effect (I get the default history widget, not my custom_command
).
zsh command-history vi-mode
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I want to replace default history search widget in vi mode with my own (binding it the the default key, i.e. /
in command mode).
Here's what I tried putting in my .zshrc
:
custom_command()
history
zle -N custom_command
bindkey -M vicmd '/' custom_command
bindkey -M vicmd '^R' custom_command
With these bindings, pressing ctrl-R
does what I expect (displays history list), but hitting /
doesn't have any effect (I get the default history widget, not my custom_command
).
zsh command-history vi-mode
I want to replace default history search widget in vi mode with my own (binding it the the default key, i.e. /
in command mode).
Here's what I tried putting in my .zshrc
:
custom_command()
history
zle -N custom_command
bindkey -M vicmd '/' custom_command
bindkey -M vicmd '^R' custom_command
With these bindings, pressing ctrl-R
does what I expect (displays history list), but hitting /
doesn't have any effect (I get the default history widget, not my custom_command
).
zsh command-history vi-mode
zsh command-history vi-mode
asked 7 mins ago
Jan Warchoà Â
381317
381317
add a comment |Â
add a comment |Â
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f480047%2fcustomize-zsh-history-search-in-vi-mode%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password