New answers tagged

1 vote

Add newline after every paragraph in log file in vi editor

I would do: :%s/\d\{4}-\d\{2}-\d\{2} \d\{2}:\d\{2}:\d\{2}/\r&/ Or: :%s/\d\d\d\d-\d\d-\d\d \d\d:\d\d:\d\d/\r&/ It inserts a new line after every date in the format you specified.
Vivian De Smedt's user avatar
1 vote
Accepted

Search and replace text in visual range but not entire line

You could do: :'<,'>s/\%V /-/ Where \%V match only if the next character is within the visual range. For more information see :help /\%V
Vivian De Smedt's user avatar

Top 50 recent answers are included