Searching word in vim?

前端 未结 4 1646
说谎
说谎 2021-01-29 18:21

I can search word in vim with /word. How can I search only for word, excluding searches for word1 and word2?

4条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-29 19:01

    For basic searching:

    • /pattern - search forward for pattern
    • ?pattern - search backward
    • n - repeat forward search
    • N - repeat backward

    Some variables you might want to set:

    • :set ignorecase - case insensitive
    • :set smartcase - use case if any caps used
    • :set incsearch - show match as search

提交回复
热议问题