Sunday, May 22, 2022

Re: scrolling during search

Tavis Ormandy wrote:

> Hello! I quite like the combination of incsearch and hlsearch, but hate
> the way it scrolls the screen to matches -- I only want the hilights
> without the scrolling.
>
> I thought maybe I could fix this with autocommands, but I can't get it
> to work, e.g.. I thought this might work:
>
> autocmd CmdlineEnter / mark S
> autocmd CmdlineChanged * normal g`S
>
> But that doesn't do anything, any ideas?

Not sure if there is a way to do this currently. There actually is code
to restrict the matches to a line range, it is used for a command like
":1,30s/pat". So you could somehow fill in the line numbers at the top
and bottom of the window, type the pattern, then remove the text before
the pattern when starting to search. But that's an ugly hack.

I'm not against adding an option for this, but we currently have no
option to change how 'incsearch' works. Adding Yet Another Option?

--
hundred-and-one symptoms of being an internet addict:
268. You get up in the morning and go online before getting your coffee.

/// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/20220522193724.5B0611C06D7%40moolenaar.net.

No comments:

Post a Comment