Wednesday, April 29, 2009

Open vim editor to first occurrence of search term

To open a file to the first instance of a search term, use the following command line with vim:


vi +/searchterm filename


You can search for the text “word1 word2” from the file filename.txt in at least two ways, vi +/word1 \ word2 filename.txt


vi +/"word1 word2" file.txt

No comments:

sanjay's shared items

My Blog List