3 votes

how to delete every char except newline?

To remove all content of a line, you can use the :substitute command (see :help substitute) like this: :s/.*// It will substitute any character (.), repeated 0 or more times (*) with nothing. It will ...
Friedrich's user avatar
  • 516
2 votes

how to delete every char except newline?

I am not sure why you want to do it, but here we go: :%norm! D This keeps the newlines, but makes every line empty. Or if you want to delete the whole buffer completely, including the line breaks: :%...
Christian Brabandt's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible