-
Notifications
You must be signed in to change notification settings - Fork 54
Regex Search
Vy uses tcl regex scheme, you can insert a regex pattern to be used by switching to NORMAL mode then pressing:
<Alt-slash>
It will open an input text widget in which you can insert a regex pattern and perform operations by pressing key-commands while the input text is active. It is named Get mode.
You achieve it by presing the keycommand below after switching to search mode:
<Alt-q>
You will notice a msg on the status bar showing the replacement that was set.
Note: The following keycommands should work on Get mode it is when the input field is active.
Once a search pattern is set, it is possible to make the cursor jump to the previous occurence of the pattern from the cursor position by pressing:
<Alt-o>
In Get mode.
After having set a search pattern, press the keycommand below in Get mode:
<Alt-p>
It will make the cursor jump to the next occurrence of the pattern.
Set a pattern and a replacement for the pattern. Make the cursor jump back/next to the pattern. Once the cursor is positioned at the pattern then press the keycommand below in Get mode:
<Alt-period>
The matched pattern will be replaced for the previously set replacement. This keycommand is specially useful when one doesn't know which matched pattern should be replaced really.
This is a powerful feature. One could select ranges of text then do searches inside these ranges. The matched patterns will be highlighed.
First, use range selection or block selection or whatever other kind of selection to select some region. Press:
<Alt-n>
insert a pattern then:
<Alt-slash>
The matched patterns will be highlighed.
Once a pattern is set, a replacement is set, then one can do replacement for the matched patterns inside a selected region by pressing the keycommand below in NORMAL mode:
<Alt-semicolon>