Vim Tips Wiki

Merge longs lines that were split by terminal window

1,625pages on
this wiki
Add New Page
Talk0 Share

Sometimes I need to copy the output of a program running in the command prompt window and paste it as text.

If the output contains long lines they are split by the command prompt window and show up as 2 or more lines in the text editor after pasting.

This command detects such long line (as having exactly 80 characters, last character being non-space) and merges them into a single line.

g/^.\{79}\S$/normal Jx

Ad blocker interference detected!

Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.