How to make vim search wrap more obvious?

2020-02-27 17:01发布

I mostly use vim (console and gvim) full screen on a large monitor. My peripheral vision tends to miss details at the bottom of the screen.

Any suggestions on how to make the "search hit BOTTOM, continuing at TOP" message that appears when the current search wraps more obvious?

I do set

set noerrorbells
set novisualbell

in my vimrc to avoid the bell/screen flash every time I type Esc. However, re-enabling those options has no effect on search wrap (still no beep or flash on wrap).

Using visual bell to indicate search wrap would work well, I think. Any idea how to implement that?

标签: vim
2条回答
够拽才男人
2楼-- · 2020-02-27 17:38

My solution for now is to adjust my color scheme to make the WarningMsg color more obnoxious (in this case, bright red background). Here's the adjusted line from my color scheme file:

hi WarningMsg ctermfg=white ctermbg=red guifg=White guibg=Red gui=None

I find this makes the search wrap message much more noticeable.

查看更多
爷的心禁止访问
3楼-- · 2020-02-27 17:56

It's hard to change that behavior, you'd have to override all built-in search commands (/, n / N, *, #, etc.) and any custom (plugin) mappings. If this is bothering you, maybe

:set nowrapscan

is worth a try. You can then still "manually" wrap via gg / G, which will soon go into your muscle memory, yet keep you alert.

查看更多
登录 后发表回答