Select multiple lines with cursors at each line start

前端 未结 4 578
悲&欢浪女
悲&欢浪女 2020-12-18 04:59

I want to select multiple lines and put a cursor at the beginning of each line. Sublime Text can do this with Ctrl-Shift-L select multiple

4条回答
  •  抹茶落季
    2020-12-18 05:34

    1. Put cursor at beginning of first line
    2. Ctrl-Shift-Alt-Arrow down/up will put a cursor at the beginning of the following/preceding lines

    3. Ctrl-I will select those lines with the cursor at the beginning of each line.

    NOTE : On my vscode the cursors look like they might be shifted down one line but they actually are not - the are in the right place. If you start typing, it works but you have to hit Enter when you are done to get back separate lines. It is a little quirky but works as you would expect.

    EDIT (using a hint from @Maxime's answer)

    1. Select your test first.
    2. Alt-Shift-I : puts cursors at the end of each of those lines but text unselected (I as in island not a lowercase L)
    3. Function-Home : put cursors at beginning of each line.
    4. Ctrl-I : selects all lines.

    Important: read the NOTE above.

    --------------------- v1.43 see How to put the cursor at the end of all selected lines in Visual Studio Code? with column selection mode it is easy to put the cursor at the beginning or end of lines selected by dragging.

提交回复
热议问题