在Vim中,当我通过输入
有人知道如何实现这种行为吗?
FYI:我正在使用以下.vimrc选项:
/x
进行增量搜索“x”时,我按下n
跳转到下一个匹配项。如果我刚刚匹配了文件中的最后一个匹配项,那么当我按下n
时,光标将开始查找文件开头的匹配项---它将循环回到开头。我不想它循环回到开头。我希望在到达最后一个匹配项后,n
能够简单地停止查找更多匹配项。我想要这种行为的原因是为了方便我查看是否已经搜索完整个文件。有人知道如何实现这种行为吗?
FYI:我正在使用以下.vimrc选项:
colorscheme zenburn " zenburn colorscheme
set nocompatible " prevent Vim from emulating Vi's bugs
set scrolloff=5 " keeps cursor away from top/bottom of screen
set nobackup " don't make automatic backups
set incsearch " incremental searching
set ignorecase " case insensitive matching
set smartcase " smart case matching
set showmatch " show matching bracket
set autoindent " indentation
set smartindent " indentation
set cindent " indenting for C code
set tabstop=4 " 4-space tabs
set shiftwidth=4 " 4-space tabs
syntax on " syntax highlighting
filetype on " behavior based on file type
filetype plugin on " behavior based on file type
filetype indent on " behavior based on file type
set visualbell " replace beeping with flashing screen
set gfn=Lucida_Sans_Typewriter:h10:cANSI