How can I search in vim for a line that has 2 specific words? -


I want to find a line near both 'foo' and 'bar' in this line, but not necessarily Besides .

I tried the following and it does not work:

  /foo.enbar  

Use:

 : set magic /foo.*bar  

'magic 'Setting determines how VIM behaves in special characters in regular expressions when it stops, VIM literally recognizes all the characters, which means that the code you wrote is foo. * Bar will actually search for that string. However, when 'magic' occurs, special reggae characters have special meaning and expect it as much as you expect. In fact to deal with old V scripts, it is always advisable to use : Set magic , so add it to your vimrc and you will be set.


Comments

Popular posts from this blog

c# - ListView onScroll event -

PHP - get image from byte array -

Linux Terminal Problem with Non-Canonical Terminal I/O app -