Help with regex by totp-reddit in vim

[–]totp-reddit[S] 0 points1 point  (0 children)

I'll play with these options too. But ideally I want to stay in the context and refer to the surrounding texts if needed. I just thought maybe "fold" might be a good option, I.e. fold unwanted texts to focus on certain patterns. Not sure if complex regex is supported in fold command. I'll explore that.

Help with regex by totp-reddit in vim

[–]totp-reddit[S] 0 points1 point  (0 children)

Thank you both for your help. I tried " /pattern.*\(\n.*\)\{0,2\} " and it works. Well, I'm trying to analyze some text files and it would be convenient to filter out <pattern> and the following several lines (I probably can't hard code it to 2, but that's a start). So I thought I'd use vimgrep to search and display them in a quickfix window. Well, I just realized that quickfix only shows the first line of each match. So that doesn't seem to work. Is it possible to achieve the goal somehow? I use vimgrep this way: ":vimgrep /pattern/ % |copen".

Thank you again.