Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-17194

Better multi-cursor / selection UX

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • Not Evaluated
    • None
    • Qt Creator 4.1.0
    • Editors
    • None

    Description

      Before anything, yes this bug is not atomic, but it's more of an Epic / User Story and I don't have the permission to create these; if anyone can change the Issue Type to User Story, please do so

      As a developer used to work within both text editors and IDEs, I enjoy the power of my IDEs but I let the great multi-cursor experience from Sublime and Atom grow on me. So when I started using QtCreator for work, I rejoiced seeing it also supports multi-cursor edition, but quickly stopped using it because its implementation is lacking in several ways. Precisely, I think four things are missing for a good multi-cursor experience in QtC:

      • {Left/Right/Up/Down, Home/End}

        shouldn't exit multi-cursor mode. Instead, it should modify position at each cursor.

      • Shift+ {Left/Right}

        shouldn't create a global selection starting at first cursor and ending at last cursor, it should enlarge/shrink multiple selections at each cursor.

      • Ctrl+LeftClick should insert cursor at Click position, and subsequent non-Ctrl clicks (or ESC key) should restore single-cursor mode.
      • There should be ExtendSelectionAndFindNext and SkipSelectionAndFindNext commands that create cursors at each selection.

      Rather than describing these in detail, I've attached a little screencast going through examples for all this, where you'll see me performing mundane changes on a random bash script from the interwebs:

      • To rename the verb variable into verbose: select text, use Ctrl+D to extend selection and create cursor, and Ctrl+Shift+D to ignore an instance I don't want to touch (a comment). Type replacement.
      • To fix some spacing: (Already doable in QtC) Using Alt+Shift+Down to create a vertical selection.
      • To replace `...` by $(...): Create cursors by Ctrl+clicking, Shift+Right to select the ``, type $(, then End to reach the end of line, again remove the backtick and type my replacement, then use the arrow keys to navigate a few columns before and add something.

      Finally, I do know Ctrl+Shift+R is the real solution to several of the operations I'm doing here, but 1. it's not always available, and 2. it's only one use case among the many manipulations doable with multi-cursors.

      For developers accustomed to Sublime/Atom this kind of manipulation is second nature, and I've seen several colleagues doing it. QtC already supports some of these tricks, but many of them are out of reach, it would be awesome to see it improve .

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              davschul David Schulz
              ronjouch Ronan Jouchet
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes