5

How can I invert a helm-swoop match, i.e. how can I show all lines not matching the pattern?

student
  • 1,099
  • 9
  • 29

1 Answers1

6

If you begin the pattern with an exclamation point, it will match lines that do not match the pattern.

So !window will match all lines that do not have window on them.

This is a helm feature, so you can use it in other places than just helm swoop.

Also note that it doesn't negate the entire search, just the token beginning with !, so you can search for, e.g., defun !--, and it will show you all lines with function definitions (defun), for public functions (i.e., they do not have -- in the name).

zck
  • 9,092
  • 2
  • 33
  • 65