Quickest way to select an entire Sass ruleset in Vim?

天大地大妈咪最大 提交于 2020-01-01 06:29:05

问题


Just starting with Vim and I wondered – given a Sass block like this:

.thing {
    width: 100%;
    color: $color1;
    .nested {
        height: 1rem;
    }
}

If my cursor is at the 'd' within 'width', what's the quickest way to visually select the entire rule set, selector, braces and all?

At present I am using 'Shift+}' to jump to the next blank line and then 'v' for visual and 'Shift+{' to select the prior block. Any better way?


回答1:


You're close. As you're already using the { and } motions to the borders of the current paragraph, just use the related text object: Vip, where V starts (linewise, but you can also use v as this text object forces this) visual mode, and ip selects the inner paragraph.



来源:https://stackoverflow.com/questions/24636276/quickest-way-to-select-an-entire-sass-ruleset-in-vim

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!