PracticalVim Tip108 - yszheda/wiki GitHub Wiki

Table of Contents

Tip 108: Call grep Without Leaving Vim

Return to the top: <>

Using grep from the Command Line

For example:

  • `-n`: include the line number in the printed output.
  • specify line number in vim:
e.g.

Calling grep from Inside Vim

References:

For example:

  • Vim parses the result and builds a quickfix list from them.
  • We can navigate through the result by `:cnext`/`:cprev`
  • Vim automatically include the `-n` flag.
⚠️ **GitHub.com Fallback** ⚠️