Expand horizontal characters in Vim in a row

Asked 1 years ago, Updated 1 years ago, 433 views

abcde

and for the string next to it, separated by spaces.

a
B
c
d
e

I'd like to deploy vertically as shown in , but is there a command that makes this behavior simple for Vim?

(On the other hand, it seems that Shift+j can do the "vertical alignment" operation, but I couldn't find a way to do the heading operation...)

Thank you for your cooperation.

vim

2022-11-15 16:41

2 Answers

You can also do :s//\r/g on the string next to it, separated by spaces


2022-11-16 04:43

I think you can replace the blank space with a new line below.

:%!tr''\n'

Enter : and then %!tr''\n'.

% covers all lines, so if you only want to cover a specific line, read the line number.
If % is line number 1, line number 2, line number 1 to line number 2.


2022-11-16 04:48

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.