Show Count of Matches in Vim

后端 未结 11 1986
孤独总比滥情好
孤独总比滥情好 2020-12-01 02:02

There is a nice feature in Google Chrome when you do a search. It tells you the number of matches there is for the keyword you are searching for. However, in Vim I don\'t se

11条回答
  •  醉梦人生
    2020-12-01 02:21

    Alternatively from what @Al suggests you can map the key combination to write most of the line and then move the cursor to the position where the actual pattern is inserted:

    :nmap ,c ^[:%s///gn^[OD^[OD^[OD^[OD

    Where '^[' is Ctrl+V,Esc and '^[OD' is Ctrl+V,Left

    Then pressing ',c' will go into command mode, enter the pattern and leave the cursor over the second '/', ready to insert the pattern.

提交回复
热议问题