Is there a way to hide all lines that did not match, while going through the list of result lines?
In a long file, I would like to search for a pattern that will match roughly 200 lines or so. The matched lines are in random places in the file.
When…
I want to see the value of a variable, so I run the command
:let
Vim displays the results of this command using the --more-- pager.
How can I search this for a phrase, e.g. html?
I've looked the man page for the more pager which says +/ is used…
We can retrieve search and replace history on IDEs and text editors.
Likewise is there a search history or a way to retrieve previously searched expression in Vim?
Is there a way to instruct Vim that I want to ignore diacritics/accents when searching? For example, I would like to be able to search for
kočička
by entering
/kocicka
The ignorecase and smartcase options are very useful, but they do not seem to…
If I want to go to the next , on the line then I type t,. If I wanted to go to the previous , I could use /n, enter, N but this is a bit of a fiddle. What is the best way to go to reverse the t command and go to the previous ,?
I need to search for lines which contain some word but do not contain a second word.
For example, find lines that contain the word "This" but not the word "red"
so that for a file containing these lines
This is a blue coat
This is a red coat
This…
If I have the following:
function foo(bar) {
return bar + 1;
}
And I use cw to change the first bar to baz, how do I jump to the next matching bar, so that I can use . to make the same change?
I can't use *, because that searches for the…
I am using vim to edit latex documents. Often, I will want to change the name of a variable to something else. However, it's a little annoying to have to wade through irrelevant matches when I search for the variable name. I would like to search…
I can search for whole words like this
/\
\< and \> match left and right word boundaries respectively.
But how can I insert those automatically? They are awkward to type out.
I like the behavior of the 'smartcase' option, which lets searches I type in by hand be case-insensitive by default, case-sensitive when there are any capital letters. I also like the behavior of the 'noignorecase' option, which lets searches…
For years I unknowingly used some, shall we say, deviant distribution of vim that would stay at the location of the highlighted search result after hitting in the middle of a search instead of jumping back to the original position.
I've tried…
When searching for a phrase in hard-wrapped text, one wants newlines to be treated as spaces. Can one have that happen? Saying /the\_sphrase\_sI\_sseek is a bit awkward.
Hi I want to search text inside gvim with the following criteria
a&b&(c|d).
I know for a&b it is /.*a\&.*b and for c|d it is /c\|d but combining these two doesnt work.
what can be the exact command ?
edit: I tried .*a\&.*b\&.*(c\|d), but it is…
When I do a /someStringtoFind in vim it immediately jumps to the closest matched string.
Almost always this is what I want it to do. Sometimes though, I want to be able to enter a string to find and not have my cursor move while I am typing the…
I have a following line in one script:
cp "$uploaddir"/"$file" "$cvsdir"/"$device"
I would like to search if this exact line is present elsewhere in the script. Usually I would do yy and then /Ctrlr0. However, this time the line contains forward…