Skip to content
Vladimir Bauer edited this page Jan 14, 2021 · 2 revisions

By default <a-/> doesn't change direction of n and <a-n>. If you'd like to reverse their direction upon <a-/> press, use the following snippet:

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>'

Relevant discussion

Clone this wiki locally