我已经知道VIM中的连接线快捷键(Shift + J)和IDEA(Alt + Shift + J)
{
var a = 1;
}
到
{var a=1;}
是否有恢复的快捷方式? 我想在HTML中轻松扩展这样的代码。
<div>hello</div>
到
<div>
hello
<div>
答案 0 :(得分:0)
如果你有类似的东西
<div>hello</div>
<div>world</div>
<div>something else</div>
你可以试试这个
:%s/>\zs[^<]*\ze<\//\r\t&\r
> ................... end of <div>
\zs ................. start of the match
[^<]* ............... anything but <
\ze ................. end of the match
< ................... start of <div>
\/ .................. protected slash "/"
\r .................. carriage return (Enter)
\t .................. tab
& ................... matched pattern in the search portion