Vim:从文件开头重启搜索?

时间:2017-07-03 16:02:17

标签: vim

如果我在vim中找到最后一个搜索词并使用/来查找下一个实例,则会显示" Pattern not found"。如何从头开始重新开始搜索?

1 个答案:

答案 0 :(得分:2)

尝试启用'wrapscan'选项:

:set wrapscan

来自:h 'ws的选项说明:

'wrapscan' 'ws'     boolean (default on)            *E384* *E385*
            global
    Searches wrap around the end of the file.  Also applies to |]s| and
    |[s|, searching for spelling mistakes.