Vim: search and highlight but do not jump

后端 未结 12 2137
一生所求
一生所求 2020-12-02 18:02

The super star (*) key in Vim will search for the word under the cursor and jump forward to the next match. The user can jump to the next matches with the n key.

12条回答
  •  日久生厌
    2020-12-02 18:38

    If you want to keep the current view and add the search to the history, try this [not so efficient] solution:

    noremap * msHmt`s*`tzt`s
    

    It is using the marks s (save) and t (top).

提交回复
热议问题