söndag 11 mars 2018

Multi-cursor editing in Visual Studio Code, edit many places simultaneously!

Did some pair programming with @nevva and saw him do some multi-cursor editing in Visual Studio Code I hadn't seen before. So here's three different ways to edit your text files at multiple places simultaneously.

Use Esc to exit multi-cursor mode.

1. Ctrl + Alt + arrow down (or arrow up)
A simpler variant of this in the classic Visual Studio is Shift + Alt + any arrow


2. Alt + left mouse click


3. Mark some text => all occurrences gets highlighted
Ctrl + Shift + L => every occurrence gets its own cursor


2 kommentarer:

  1. I love to use multi-cursor while coding or solving other text issues. It is just faster! Especially nice during html-markup or similar tasks.

    There are however - inconsistent behavior across software and I guess implementations.

    For instance Notepad++ and Visual Studio are mostly alike but there are differences. All text inputs should have more functions in general in my opinion.

    SvaraRadera
    Svar
    1. Oh, I didn't know that notepad++ has it too, thanks for mentioning it! :)

      https://stackoverflow.com/questions/3453151/notepad-multi-editing

      Radera