Sublime Forum

NeoVintageous: Using ST's native find panel for search (and few more...)

#1

I’ve installed the NeoVintageous plugin a week ago, and I find it awesome. Just a few questions I cannot answers myself:

  1. More often than not, I do verbatim search, not regexp, so it’s convenient not to bother about escaping any symbols… In the native Vintage plugin the search is performed with the regular Find panel, where I can toggle regexp (alt+r), case-sensitivity (alt+c), etc. Is it possible to have that option in NeoVintageous? (for sure, I can make regular search with NV, but then it doesn’t work with n and N keys to jump to next/previous match, etc.). Also, for some reason, NV’s search is different in terms of performance. E.g., if I put . (regex for any character) as the first symbol in the NV’s search field in a file with ~5000 lines, it takes 4-5 seconds to respond, although native Find panel reacts immediately for the same input and the same file (with regexp option on).
  2. While in normal mode ctrl+r does work as redo, in insert mode ctrl+r followed by the register is supposed to paste text. But it doesn’t work (ctrl+r opens the standard Goto Symbol panel).
0 Likes

#2

Performance issues

It would be great if you could open a bug report with a debug log and I’ll try look into it. This is something that can be fixed. See https://github.com/NeoVintageous/NeoVintageous/blob/master/CONTRIBUTING.md#debugging.

CTRL-r

There are several open issues relating to the ctrl-r issue:

Search

It’s not possible to use Sublime’s built in find widget at the moment. There are a number of features that we wouldn’t be able to implement due to limitations in the Sublime API and there’s no documentation on how we could use the widget.

For example, in Vintage after you press enter, none of the matches are highlighted, they are in NeoVintageous and stay highlighted as you cycle through the matches pressing n and N. Similarly when you use commands like *, #, etc. neo highlights the matches.

Additional search features

There are still a number of outstanding issues with the search feature in Neo that I’ve been wanting to address.

What is not yet implemented are search prefix modifiers, for example we should be to prefix searches with \v or \m or \M or \V, all of which change how the pattern is interpreted, for example:

Examples:
after:    \v       \m       \M       \V         matches 
                'magic' 'nomagic'
          $        $        $        \$         matches end-of-line
          .        .        \.       \.         matches any character
          *        *        \*       \*         any number of the previous atom
          ~        ~        \~       \~         latest substitute string
          ()       \(\)     \(\)     \(\)       grouping into an atom
          |        \|       \|       \|         separating alternatives
          \a       \a       \a       \a         alphabetic character
          \\       \\       \\       \\         literal backslash
          \.       \.       .        .          literal dot
          \{       {        {        {          literal '{'
          a        a        a        a          literal 'a'

See: https://vimhelp.org/pattern.txt.html#/magic

I think implementing those modifiers and fixing some of the search quirks would alleviate most of the issue.

You can already enable and disable magic mode globally, see the magic option (https://github.com/NeoVintageous/NeoVintageous/blob/master/res/doc/neovintageous.txt#L322). That is the same as prefix the search with \m (enable) and \M (disable)` (though there are still some issues in how neo current interprets the pattern).

I’ve opened an issue here: https://github.com/NeoVintageous/NeoVintageous/issues/641

0 Likes

#3

Many thanks for the clarifications. As I see, the issue with Ctrl+R in insert mode was reported already 2.5 years ago. So that’s probably something one should not hope to expect very soon, if at all? (In fact, if I’m not mistaken, all key bindings in insert mode are just plain standard shortcuts; e.g., ctrl+h is find and replace rather than delete preceding character).

0 Likes