True column-mode (block-selection and editing) text editor solution?

45,284

Solution 1

geany Install geanyInstall via the software center

is an integrated development environment that provides good column editing support which is worth checking out (an example here)

Simply put, press down Alt+Shift instead of just Shift while making selections to invoke column mode. One important limitation is that the edits in column mode are (as yet) not undo-able.

To achieve the same with the mouse, hold down Ctrl while selecting. This actually works with most Scintilla-based editors (including SciTE and Geany).

Solution 2

To edit columns, I use vi / gvim. It takes a bit of learning to get used to vi, but in the end many people find this to be their preferred editor.

Specifically within vi you can use CTRL V to highlight columns in visual mode, then you can edit it as you would expect. I use this all the time for adding and removing comments, or indenting functions i.e. CTRL V (highlight a column) SHIFT I # ESC will comment out that entire column.

Solution 3

You do use the Eclipse editor. Alt+Shift+A should do what you need.

Solution 4

nedit Install nedit Install via the software center

I use NEdit all the time.

To install it using the terminal, use the following command:

sudo apt-get install nedit

Old school (Motif) but has tabs and is lightweight and simple. Has context highlighting included for a number of coding languages, and more can be added. Pressing Ctrl while dragging with the mouse enables a block of text to be selected. Then you can copy/paste as usual. Couldn't do without this feature now.

Solution 5

Also Notepadqq can do this: they briefly present the feature in their page. Hold down Alt, then hold Ctrl or Shift, and select the "columns" you want by dragging (or also clicking, if you are holding Ctrl) with the mouse. Release the buttons when you are done selecting columns, and start editing by typing, using arrow keys, copy-paste (a mouse click will cancel the multi-selection).

The points you select don't need to form a real column, it's an arbitrary number of cursors active at same time. When you copy-paste, the text is pasted cursor-by-cursor if the number of copied and pasted ones matches, otherwise every target cursor gets a full copy of the input.

Little nuisances: you can't de-select single cursors while keeping the others, and you can't use the keyboard to select them (or at least, I don't know how to).

Share:
45,284
tamale
Author by

tamale

mid 30's computer geek from illinois cloud sre at confluent.io die-hard ubuntu/linux/open-source fan

Updated on September 17, 2022

Comments

  • tamale
    tamale over 1 year

    In windows, I used to use a text editor called crimson editor which featured the best column-mode editing support I have yet to use.

    When enabled via a simple Alt-C shortcut, selections could be made with the mouse or cursor keys and they would be visual blocks rather than wrapped-lines.

    These selections could be deleted, moved, copied, pasted, and all of the operations just made sense. You could also just start typing, and you'd get a column of the characters as you're typing.

    There are multiple ways of getting parts of the these features working separately discussed on this forum thread, but no one has yet to provide a solution that provides this all-encompassing and easy-to-use method.

    If someone could point me to a gedit plugin where this work is actively being pursued, perhaps I could help with the coding myself. If someone is aware of a text editor that already provides this full functionality, I'd appreciate the info. Running crimson editor through wine and the close-but-not-quite multi-edit plugin for gedit are the temporary solutions I'm 'getting by with' for the time being.

    UPDATE (2012-11): I'm now a very happy user of sublime text. It supports excellent column-mode editing and works on all three major OS platforms without any issue. Highly recommended!

    • koushik
      koushik over 13 years
      If you are familiar with emacs, emacs provides column editing support via many modes but requires getting used to (aka learning curve). I can detail if it will answer your question.
  • tamale
    tamale over 13 years
    I'm trying Geany and working with the column selection is quite nice.. it's almost there. Do you know if I make a block selection with the mouse?
  • JanC
    JanC over 13 years
    Hold down Ctrl while selecting with the mouse. This actually works with most Scintilla-based editors (including SciTE and Geany).
  • koushik
    koushik over 13 years
    @JanC - Thanks for the input. I have updated my answer with this.
  • tutuca
    tutuca over 13 years
    But... gmate provides block editing?
  • AndyB
    AndyB over 13 years
    Ctrl+PgDn/PgUp let you select the rows at once for block editiing. Also you can Ctrl+Left click to select variables to edit them at once.
  • Benji
    Benji over 13 years
    SciTE is also available on both Windows and Ubuntu, which you may find useful if you work on both platforms.
  • hakre
    hakre about 12 years
    Works great on Fedora, too. I love geany!
  • NeoShow
    NeoShow over 11 years
    @AndyB, what is exactly the name of the plugin that must be activatited? These shortcut keys don't work after installing gmate. (I am using gedit 3.4.2)
  • Iain Samuel McLean Elder
    Iain Samuel McLean Elder over 10 years
    Can you select a block using just the keyboard?
  • Josh Newham
    Josh Newham over 5 years
    got gmate, but how to do column selection?
  • kubanczyk
    kubanczyk about 5 years
    Sure, with keyboard use Shift+Alt+arrows. I don't see column typing though (only column paste and indentation).