Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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!

share|improve this question
    
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. –  koushik Oct 12 '10 at 15:03
add comment

7 Answers 7

up vote 15 down vote accepted

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).

share|improve this answer
    
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? –  tamale Oct 12 '10 at 15:14
1  
Hold down Ctrl while selecting with the mouse. This actually works with most Scintilla-based editors (including SciTE and Geany). –  JanC Oct 12 '10 at 15:31
    
Excellent!! Thank you. –  tamale Oct 12 '10 at 15:53
    
@JanC - Thanks for the input. I have updated my answer with this. –  koushik Oct 12 '10 at 16:24
    
SciTE is also available on both Windows and Ubuntu, which you may find useful if you work on both platforms. –  Firefeather Oct 13 '10 at 14:40
show 1 more comment

To edit columns, I use vi / gvim. This will take 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 ie CTRL-V (highlight a column) SHIFT-I '#' ESC will comment out that entire column.

share|improve this answer
add comment

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.

share|improve this answer
    
Can you select a block using just the keyboard? –  Iain Elder Nov 18 '13 at 15:46
add comment

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

share|improve this answer
add comment

Use a gEdit with gmate and plugins. You'll get the TextMate of Linux.

sudo apt-get install gedit gedit-plugins
cd ~/Downloads
git clone http://github.com/gmate/gmate.git
cd gmate
sh ./install.sh

With this "slight" modification gEdit really rocks.

share|improve this answer
    
But... gmate provides block editing? –  tutuca Oct 13 '10 at 12:01
    
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. –  AndyB Oct 13 '10 at 12:31
1  
@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) –  alfC Oct 3 '12 at 18:09
add comment

This is possible in emacs, and it's easy if you use the cua-mode. C-return marks the upper left of the rectangle. Then move the cursor to highlight the rectangular region.

The emacs column mode features are really cool. They go far beyond just copy/paste of rectangular text. Check out the video for a demo of how to simultaneously edit all the lines in the column! Very handy!

If you don't want to watch the video (or can't) here are the bare basics:

CUA-mode's superior rectangle support is based on using a true visual representation of the selected rectangle. To start a rectangle, use [S-return] and extend it using the normal movement keys (up, down, left, right, home, end, C-home, C-end). Once the rectangle has the desired size, you can cut or copy it using C-x and C-c, and you can subsequently insert it - as a rectangle - using C-v. So the only new command you need to know to work with CUA-mode rectangles is S-return!

On Kubuntu 12.04 and emacs v24, [S-return] is CONTROL-RETURN (CTRL-ENTER) for me.

As already mentioned, Scite has this built-in (no plug-ins needed). It's very easy to use. And Scite is in the Ubuntu repos.

Rectangular blocks of text can be selected in SciTE by holding down the Alt key on Windows or the Ctrl key on GTK+ while dragging the mouse over the text.

share|improve this answer
add comment

Paste this commands in terminal

sudo sed -i.backup -r '/^#\s?deb\s?(http|ftp|-src).*(partner|multiverse|universe)/s/^#\s?//g' /etc/apt/sources.list

sudo apt-get update

sudo apt-get -y vim-gnome vim-doc

vim yourfile

In vim use:

ctrl-v ....... to select in mode column
j ............ to down 

see:

 :help
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.