【问题标题】:Is there a shortcut to expand lines in IDEA and VIM在IDEA和VIM中是否有扩展行的快捷方式
【发布时间】:2018-03-30 02:42:47
【问题描述】:

我已经知道 VIM(Shift + J) 和 IDEA(Alt + Shift + J) 中的 Join Lines 快捷键

{
   var a = 1;
}

{var a=1;}

有恢复的快捷方式吗? 我想在 HTML 中轻松扩展这样的代码。

<div>hello</div>

<div>
    hello
<div>

【问题讨论】:

标签: intellij-idea vim shortcut


【解决方案1】:

如果你有这样的事情

<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

【讨论】:

    猜你喜欢
    • 2013-08-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-10-11
    • 2019-03-17
    • 1970-01-01
    • 1970-01-01
    • 2018-07-13
    相关资源
    最近更新 更多