Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make vim search wrap more obvious?

Tags:

vim

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?

like image 403
David Avatar asked Jul 02 '13 14:07

David


2 Answers

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.

like image 76
Ingo Karkat Avatar answered Oct 19 '22 23:10

Ingo Karkat


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.

like image 42
David Avatar answered Oct 19 '22 22:10

David