各编辑器中的合并行功能 join lines

vscode 中的合并行功能,要在 帮助->显示所有命令 中输入 合并行 找到;
notepad++ 中的合并行功能,在 编辑->行操作->合并行,快捷键为ctrl j
而我的需求是合并行,并且不添加空格。

一种是是使用正则表达式,把换行符删除掉;
一种是home键 删除键不停地按,手动删除换行;
一种是使用vim可视模式下的gJ;
一种是Notepad++录制宏,一种是Emeditor录制宏。

最后,经过探索,https://stackoverflow.com/a/12466885/12578184
给出的使用vim可视模式下的gJ是最好最快的方案。

I have a feeling this is what you really want: gJ

From :h gJ:

gJ          Join [count] lines, with a minimum of two lines.
            Don't insert or remove any spaces.  {not in Vi}

在windows上使用Gvim,这一搭配了GUI的vim。另外,在git bash中输入vimtutor zhcn命令可以打开中文版vim简易入门教程。

posted @ 2022-05-14 20:26  lingr7  阅读(191)  评论(0编辑  收藏  举报