One of the Vim's features I like too much is its ability to search different words at once in text.
When we want to find a word we enter in command mode and we type:
/word <ENTER>
- But what if we want to find two or more words ? Do we need to do separate searches?
No! We do just one search in command mode with each word separated by escaped pipes (\|) :
Figure 1 shows a search for four words. Notice that spaces are considered as part of the word we are looking for.
Figure 2 shows the result of the search.
I hope this tip will be as useful for you as it is for me.
No! We do just one search in command mode with each word separated by escaped pipes (\|) :
/word1\|word2\|word3 <ENTER>
Figure 1 shows a search for four words. Notice that spaces are considered as part of the word we are looking for.
Figure 2 shows the result of the search.
I hope this tip will be as useful for you as it is for me.
Um comentário:
Well written article.
Postar um comentário