Is there a way to emulate ReSharper's “extend selection” feature in Vim?

前端 未结 5 641
轮回少年
轮回少年 2021-02-09 04:32

ReSharper has a nice feature called \"extend selection\": by pressing CTRL+W (I think this is the default) repeatedly, you select more and more from your current ca

5条回答
  •  时光取名叫无心
    2021-02-09 05:18

    The answer is yes. Once in Visual mode you can use all the regular navigation methods as well as some extra ones.

    Some of my favourites? First hit v while in normal mode to get to visual mode then hit:

    1. iw - to select the inner word. Great for selecting a word while excluding surrounding braces or quotes
    2. w - hit multiple times to keep selecting each subsequent word.
    3. b - select wordwise backwords
    4. ^ - select all from current position to beginning of text on line
    5. $ - select all from current position to end of line

    I'm sure others here could add to this list as well. Oh and don't forget Visual Block mode C-v try it out in vim with the above commands it works in two dimensions :-)

提交回复
热议问题