-3

我有以下几行的文件:

'Books',
'Business',
'Education',
'Entertainment',
'Finance',
'Games', 
'Healthcare & Fitness', 
'Lifestyle', 
'Medical', 
'Music'

我需要以下格式,输入为 5:

'Books','Business','Education','Entertainment','Finance',
'Games','Healthcare & Fitness','Lifestyle','Medical','Music'
4

2 回答 2

3

假设您的光标位于第一行,您可以:

5gJj.
  • :h gJ知道它的作用。
  • j.-> 移动到下一行重复上一个命令 ( 5gJ)
于 2018-07-03T12:35:58.750 回答
0

您可以使用 gelobal 命令

:g/^/normal 5J

无论行数多少,vim 都会加入 5 行的组

于 2018-07-15T17:25:45.100 回答