I want to find all lines where column 78 (the 78th character on the line) is not a space.
Ideally, I'd like to use it like a normal search.
You can use this pattern:
\%78c\S
\%78c
matches position at column78 (Actually, the column is the byte number thus it's not exactly right for multi-byte characters). Use \%78v
to match virtual column.\S
matches non-spaceI guess you need not what @kev or you suggest: while you correctly find 78’th character (with character+diacritics counting for one) and @kev correctly finds 78’t byte it looks like you are solving something like “text beyond 78 column border”. If my assumption about your task is true then you should use
\%78v\S
(\%{number}v
matches virtual (screen) column). If not, better to use your answer, I never saw a need in using \%{number}c
except for in some generated patterns.
I figured it out, leaving as an example in case someone tries this in the future:
If I want to match column "n", I just need to match anything of column "n-1" and then do my criteria for column n. The following expression finds all lines that have column 35 not equal to space.
^.\{34}[^ ]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With