I am wondering if there is a way to find the template, but limit it to the current line. Basically, the equivalent of /PATTERN , but limited to the current line, not the entire document.
I tried :s/PATTERN , but this removes the pattern from the line and places my cursor at the beginning of the line, which is not what I need at all. I was hoping you could search without replacement ...
I hope to use this as a macro to place my cursor at the beginning of this template, as it would when you do /PATTERN across the entire file, so anything that is macro-friendly is even better.
Any vim users who may have an idea?
EDIT: 0/PATTERN in the macro will work for my current need, but I hope there is a more specific way to limit the search.
ANSWER: There are several publishing methods here, but the one I like best right now uses Shift+V to visually display the current line, and then /\%V to search only in the visual selection. Then Shift+V will turn off the visual mode again.
source share