Regex to insert space in vim

前端 未结 4 1335
轻奢々
轻奢々 2021-02-05 13:57

I am a regex supernoob (just reading my first articles about them), and at the same time working towards stronger use of vim. I would like to use a regex to search for all inst

4条回答
  •  深忆病人
    2021-02-05 14:51

    You want to use a zero-width negative lookahead assertion, which is a fancy way of saying look for a character that's not a space, but don't include it in the match:

    :%s/: \@!/: /g
    

    The \@! is the negative lookahead.

提交回复
热议问题