vim as my
$MANPAGER. I will often use
:/^[ ]*-F (for example) to quickly jump to a flag and read up on it. However, the equivalent
:/^[\s]*-F doesn't return the same results.
The character classes such as
\s for spaces or
\d for digits do not work inside a
[ ] collection in the Vim flavor of regexp. So
[\s] is actually matching either a backslash or a lowercase "s".
But in your case, you don't need a
[ ] collection anyways, because the
\s is the only thing you're matching there.
So this should work just fine:
One alternative is to use a full character class expression (not one using the
\-letter shorthand notation, but the
[:class:] one), in which case
/^[[:blank:]]*-F is what you want here (
[:blank:] is the one matching a space or a tab, same as