Hi James! On Do, 23 Jul 2015, James McCoy wrote:
> Recently, I've heard some script authors ponder whether there was a way > to access information about the last character search a user performed. > The ideas being explored were overriding ; and , to always search > forward/backward respectively, or providing visual cues for where a > character search would move the cursor. > > There exists a mechanism for script authors to interact with normal > searches via the / register and the v:searchforward variable. > > The attached patch implements comparable functionality for character > searches. > > * A new, read-write ; register exposes the character which would be the > target for a subsequent ; or , command. If this register is set, then > the direction and type of character search are (re)set as if the user > had used t to perform the search. > > * A new, read-write v:csearchforward variable exposes the direction of > the character search, similar to v:searchforward. > > * A new, read-write v:csearchuntil variable exposes whether the search > is an "until" (t) search. > > * Any normal character searches which happen within a function or > autocmd will not affect the user's character search state, similar to > the handling of normal searches. However, a script author may affect > that through using the above listed variables/register. > > Aside from enabling script authors to better interact with character > searches, this also makes it easier to search for composed characters > using character search. One currently has to create a keymap file and > use “:loadkeymap” to easily enter a composed character as the character > search value. With this functionality, one can instead simply “:let > @;="a\u0301"” to search for á. > > Cheers, +1 for the whole idea. I'd like to make my improvedft plugin easier to use. Best, Christian -- Es ist verboten etwas zu verbieten. -- -- You received this message from the "vim_dev" 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_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
