Volker Siegel
  • Member for 6 years, 11 months
  • Last seen more than a month ago
  • Berlin, Germany
Clear a line faster than [0][d][$]
7 votes

Clear the line with one (shifted) key: S. This also keeps the indent. You go into insert mode at the first position after the indent, or at start of line - just what you need to substitute a line - ...

View answer
Insert a pattern before another one
0 votes

Why not just replace pattern2 by \n pattern1 pattern2? :%s/pattern2/\rpattern1 pattern2/g or without repeating pattern2: :%s/\(pattern2\)/\rpattern1 \1/g Both change pattern1 any text pattern2 ...

View answer