7 votes

You don’t need more than one cursor in vim

7 comments

  1. tesseractcat
    Link
    The author of this post suggests macros as a replacement for multiple cursors, but in my experience multiple cursors are just a really nice way to interactively construct macros, and see their...

    The author of this post suggests macros as a replacement for multiple cursors, but in my experience multiple cursors are just a really nice way to interactively construct macros, and see their effects on many selections at the same time. Also, I greatly prefer vim-visual-multi to vim-multiple-cursors (although I wish vim would add native multi cursors support, along with structural regular expressions).

    7 votes
  2. [5]
    mrnd
    Link
    For an alternative perspective, see Kakoune. It is is vim-inspired text editor that has multiple cursors. Its philosophy attempts to improve upon vi: by reversing the command order (verb-object to...

    For an alternative perspective, see Kakoune. It is is vim-inspired text editor that has multiple cursors. Its philosophy attempts to improve upon vi: by reversing the command order (verb-object to object-verb) it gains easier interactivity with the same power as vim.

    Kakoune tries hard to fix one of the big problems with the vi model: its lack of interactivity. Because of the verb followed by object grammar, vi changes are made in the dark, we don’t see their effect until the whole editing sentence is finished. 5dw will delete to next five words, if you then realize that was one word too many, you need to undo, go back to your initial position, and try again with 4dw. In Kakoune, you would do 5W, see immediately that one more word than expected was selected, type BH to remove that word from the selection, then d to delete. At each step you get visual feedback, and have the opportunity to correct it.

    This leads to a very different approach to multiple cursors, and they are central to how kakoune works.

    Multiple cursors don't really fit vim-the-editor, but that doesn't mean that they are bad fit for vim-the-idea.

    3 votes
    1. [3]
      tesseractcat
      (edited )
      Link Parent
      I think that multiple cursors actually mesh pretty well with vim-the-editor. I'm a huge fan of vis, which does exactly this. EDIT: Also, I've posted this before, but Why Not Kakoune.

      I think that multiple cursors actually mesh pretty well with vim-the-editor. I'm a huge fan of vis, which does exactly this.

      EDIT: Also, I've posted this before, but Why Not Kakoune.

      2 votes
      1. [2]
        mrnd
        Link Parent
        Sure – I am not saying it can't work. It just doesn't seem to fit how vim likes to do things. And isn't vis more like vim-inspired, like kakoune?

        Sure – I am not saying it can't work. It just doesn't seem to fit how vim likes to do things. And isn't vis more like vim-inspired, like kakoune?

        1 vote
        1. tesseractcat
          Link Parent
          Well, vis is just regular vim keybindings with structural regex and multi cursor. Personally I'd rather they'd have implemented it as a plugin, or extended neovim. Vis as an editor by itself is...

          Well, vis is just regular vim keybindings with structural regex and multi cursor. Personally I'd rather they'd have implemented it as a plugin, or extended neovim. Vis as an editor by itself is clunky because I'm missing a lot of features that I have from standard vim and plugins.

    2. crdpa
      Link Parent
      Can't go back to anything after using kakoune. For people who uses VSCode, there is a plugin called dance that emulates kakoune.

      Can't go back to anything after using kakoune.

      For people who uses VSCode, there is a plugin called dance that emulates kakoune.

  3. Apos
    Link
    I've been enjoying multiple cursors with the vim extension in vscode.

    I've been enjoying multiple cursors with the vim extension in vscode.