Using the vim search capabilities, you can avoid a match in the comment block / line.
As an example, I would like to combine into an 'image' in this python code, but only in the code and not in the comment:
if export_images and i + j % 1000 == 0:
export_image(img_mask, "images/image{}.png".format(image_id))
image_id += 1
Using regular expressions, I would do something like this: /^[^#].*(image).*/gm
But this does not work in vim.
source
share