Make 'n' always search forwards, regardless of whether / or ? was used for searching

前端 未结 2 889
臣服心动
臣服心动 2021-02-09 07:39

I almost always search in Vim with /, and then continue searching forwards with n and backwards with N. Sometimes, however, I use ?<

2条回答
  •  既然无缘
    2021-02-09 08:09

    That is just the way it is, notwithstanding some debate on the developers' mailing list ...

    Here's what you can do about it:

    :noremap n /
    :noremap N ?
    

    Relevant mailing list thread with a lot more interesting info: https://groups.google.com/d/msg/vim_dev/8jSoA931P2Y/JklYtxFOiAYJ

提交回复
热议问题