Hi Christian,

On Tue, Jul 26, 2016 at 10:15 AM, Christian Brabandt <cbli...@256bit.org> wrote:
> Hi Yegappan!
>
> On Do, 14 Jul 2016, Yegappan Lakshmanan wrote:
>
>> Hi all,
>>
>> My wish list for extending the Vim search feature:
>>
>> 1. When searching for a pattern, pressing a key at the search prompt
>>     should jump to the next or previous match.
>> 2. After jumping multiple times from the search prompt, pressing the
>>     escape key should restore the cursor to the original cursor position
>>     before the search.
>> 3. Pressing backspace at the search prompt to erase a few characters and
>>     then typing additional characters should start the search from the
>>     previously matched position and not from the original position.
>> 4. As characters are typed at the search prompt, all the matching text
>>     should be highlighted (multiple matches). This can be turned on/off by
>>     an option.
>>
>> I know there are some Vim plugins that support some of these features.
>> But it will be useful to extend the built-in Vim feature to support these
>> features.
>
> Here is an experimental patch, that does this using Ctrl-N Ctrl-P in
> search mode, when 'incsearch' is set. I am not super happy, about
> depending on 'incsearch', but on the other hand, Ctrl-L already only
> works when 'incsearch' is set. Also I am open to suggestions for
> alternative keys, although I must admit, Ctrl-N/Ctrl-P seem like logical
> choices.
>
> It doesn't do everything you want, but it seems to work well for me. I
> made it so, that pressing enter will remain at the current selected
> match, which seems obvious and so I did not need to introduce a new key
> function. Pressing ESC however will return the cursor to the position
> where you started with the search.
>
> This was just written very fast, I am pretty sure, there are some bugs
> lying around and also tests are missing. But if this turns out to be
> useful, I'll work more on it (and add a test of course).
>
> Comments welcome,
>

Thanks for implementing this feature. I am very happy to see this.
I tried the feature and faced the following issues:

1. When pressing CTRL-N or CTRL-P to jump to the next/previous match,
   the 'nowrapscan' setting is ignored and the search wraps around
   the file.
2. After pressing CTRL-N couple of times, erasing the entire search pattern
   and typing a new pattern doesn't search from the original cursor
   position. Instead the search starts from the last matched position.
3. Searching for a pattern, pressing CTRL-N (which doesn't find a
   next match) and then pressing CTRL-L to copy the next character
   from under the cursor doesn't work and also the search highlighting
   is removed.

Regards,
Yegappan

-- 
-- 
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 vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui