[clug] vim search: two blanks NOT at the start of a line

steve jenkin sjenkin at canb.auug.org.au
Sun May 3 05:05:37 UTC 2020


Useful tidbit for text cleanup: where have I stuttered blanks, but ignore indenting:
[pattern enclosed in ‘ quotes to expose spaces]

	'/\S\s*\zs  ‘

I also use this pattern to find where sentences might end (any punctuation mark followed by a blank char):

	'/[[:punct:]] ‘


I didn’t know how exclude commas from the list of punctuation marks:

	'/[[:punct:]]\&[^,] '


With all the backslash terms (eg \S), there’s probably already a predefined special term for “end of sentence”,
just as I can jump between paras in visual mode (old ‘vi’ style).

Credit:

Pattern match not at beginning of line
<https://stackoverflow.com/questions/30184554/match-a-pattern-in-vim-not-in-the-beginning-of-line>

How to use Intersection, union and subtraction in Vim regular expression character class
<https://stackoverflow.com/questions/39236488/how-to-use-intersection-union-and-subtraction-in-vim-regular-expression-charact>

--
Steve Jenkin, IT Systems and Design 
0412 786 915 (+61 412 786 915)
PO Box 38, Kippax ACT 2615, AUSTRALIA

mailto:sjenkin at canb.auug.org.au http://members.tip.net.au/~sjenkin




More information about the linux mailing list