加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

如何在VIM中将多行合并为一行?

发布时间:2020-12-15 09:23:21 所属栏目:安全 来源:网络整理
导读:例如: 我想合并这样的文本 CATEGORIES = [‘Books’, ‘Business’, ‘Education’, ‘Entertainment’, ‘Finance’, ‘Games’, ‘Healthcare Fitness’, ‘Lifestyle’, ‘Medical’, ‘Music’, ‘Navigation’, ‘News’, ‘Photography’, ‘Producti
例如:

我想合并这样的文本

CATEGORIES = [‘Books’,
‘Business’,
‘Education’,
‘Entertainment’,
‘Finance’,
‘Games’,
‘Healthcare & Fitness’,
‘Lifestyle’,
‘Medical’,
‘Music’,
‘Navigation’,
‘News’,
‘Photography’,
‘Productivity’,
‘Reference’,
‘Social Networking’,
‘Sports’,
‘Travel’,
‘Utilities’,
‘Weather’,
‘All’,]

进入

CATEGORIES = [‘Books’,‘Business’,‘Education’,‘Entertainment’,‘Finance’,‘Games’,‘Healthcare & Fitness’,‘Lifestyle’,‘Medical’,‘Music’,‘Navigation’,‘News’,‘Photography’,‘Productivity’,‘Reference’,‘Social Networking’,‘Sports’,‘Travel’,‘Utilities’,‘Weather’,‘All’,]

在命令模式下:
[range]j[lines]

EG:这里你想做整个缓冲区:

%j

如果你只是想从当前光标位置做10行:

j10

如果你不想用空格替换新行使用!后j。

%j!
j!10

和为了uberfancy:

5j20

会去第5行,并加入接下来的20行。

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读