23

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?

2 Answers 2

14

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.

1
  • 2
    Thanks for the suggestion. I have tried your suggestion before but found I too often missed matches above when nowrapscan was on. I wouldn't mind remapping search commands but there's still no way I can see to know when the search wraps.
    – David
    Jul 2, 2013 at 20:05
11

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.

4
  • Wow! That's really just the bit that was missing there! Of courese it makes other warnings more prominent to - otherwise I would say "That should be obviously be the default" - which is hard enough to find a case to say that, including the "obvious"! Jan 29, 2016 at 23:37
  • 5
    Note: in vim version 8, the message is more subtle by default (indicating a position within a number of occurrences). Add S to shortmess to revert back to the version 7 "search hit BOTTOM, continuing at TOP" message: set shortmess+=S. I wish there were a way to get both.
    – jrw32982
    Feb 5, 2020 at 22:07
  • @jrw32982supportsMonica is there a way to have both the visually obvious message and the handy match counter?
    – 0x539
    Aug 16, 2020 at 1:13
  • @0x539 I don't know. I haven't found it yet. I'd be interested in hearing if you find one.
    – jrw32982
    Aug 16, 2020 at 18:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.