J命令转换两行,如
foo
bar
在
foo bar
转换
是可能的foo
bar
在
foobar
没有" Jx"? Jx线有其他方法吗?
答案 0 :(得分:4)
gJ
将在不创建新空间的情况下加入行。
*gJ*
gJ Join [count] lines, with a minimum of two lines.
Don't insert or remove any spaces. {not in Vi}
答案 1 :(得分:0)
如果您想避免在连接的行之间插入任何额外的空格,请使用:j!
(:join!
)命令(请参阅:help :join
)而不是 J
例如,可以使用以下命令将 J 重新映射到:j!
:
:nnoremap J :j!<CR>