rg -C 3 "func" — search with surrounding context lines

rg -C 3 "func" — search with surrounding context lines

rg -C 3 "func"

The -C flag prints N lines of context before and after each match, making it easier to understand the code surrounding a hit. rg -C 3 "func" shows each function definition with three lines of context on both sides.

#search #ripgrep #context #lines #code

下载

⬇ GIF (209.6 KB) ⬇ MP4 (转换中...)

嵌入

[![rg -C 3 "func" — search with surrounding context lines](https://media.agentgif.com/preseed/rg-context/demo.gif)](https://agentgif.com/@agentgif/rg-context)
<a href="https://agentgif.com/@agentgif/rg-context"><img src="https://media.agentgif.com/preseed/rg-context/demo.gif" alt="rg -C 3 "func" — search with surrounding context lines" width="1200"></a>
<iframe src="https://agentgif.com/embed/zeIkCYQp/" width="1200" height="660" frameborder="0" allowfullscreen></iframe>
<div data-agentgif="zeIkCYQp"></div><script src="https://agentgif.com/widget.js" async></script>
作者: @agentgif · · 40 次查看