-
Notifications
You must be signed in to change notification settings - Fork 722
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reverse search <a-/> orthoganality #3925
Comments
Setting a side effect on primitives predicated on which one was used previously doesn't sound great, it's not predictable. One problem I can see would occur upon a user using a-/, then *. I think the user would expect that subsequently hitting n would select the next (downward) match, but since * modifies the search register |
I think this behaviour could make for a good plugin, or at least a good snippet for the users' configuration. Here's my quick implementation of it: define-command -hidden -params 1 search_direction %{ evaluate-commands %sh{
case "$1" in
up) echo "
map global normal n <a-n>
map global normal <a-n> n
exec <a-/>
";;
down) echo "
map global normal n n
map global normal <a-n> <a-n>
exec /
";;
esac
} }
map global normal <a-/> ': search_direction up<ret>'
map global normal / ': search_direction down<ret>' If you do decide to adapt the above code and use it in your user configuration, could you please document it in the wiki? |
Nice solution!
Yes of course, I think placing it under Editing paragraph. Is it ok? |
Sounds good, I rarely care about what's on the wiki, so feel free to create pages as you see fit. |
While regular searching with
/
directions ofn
and<a-n>
are natural and orthogonal i.e. former jumps down and latter jumps up. However while reverse searching with<a-/>
directions ofn
and<a-n>
are the same as in regular search. I expected that in reverse searchn
and<a-n>
would reverse their directions respectively, but this is not the case. Thereverse
part of<a-/>
is only in its initial jump and afterwards I still have to hold alt key to keep reverse direction, which in my opinion is not so orthogonal.The text was updated successfully, but these errors were encountered: