How to highlight rectangles of text?
January 5, 2009 1:26 PM   Subscribe

In a monospace text editor, how can I highlight a bounded, rectangular area?

I want to use my mouse (or keyboard) to drag over a few columns, then down several rows, selecting only what is within these bounds. Normally when I do this, scrolling down will highlight all the text on rows between the start and stop points. I want to be able to highlight an entire column of data and press delete, having the text on each row shift left the given amount. My specific application is manipulating aligned tables of data in TeXnicCenter for publication.

Is this where I need to learn emacs/vim?
posted by casaubon to Computers & Internet (6 answers total)
Is this where I need to learn emacs/vim?

Well, you don't need to, but yes, Emacs can do that. You would put your cursor at one corner of the rectangular region you want to delete, set the mark with C-Space, move the cursor to the diagonally opposite corner of the rectangular region, and hit C-x r k.
posted by letourneau at 1:32 PM on January 5, 2009

Best answer: This is usually dependent on either your specific editor or OS having the facility to do this. You can try holding down Alt while you select your text. If that doesn't work, try TextPad.
posted by mkb at 1:33 PM on January 5, 2009

Best answer: Try holding down alt while dragging the mouse. That's how Visual Studio does rectangular selection, and I wouldn't be surprised if other text editors mimic its behavior.
posted by zsazsa at 1:33 PM on January 5, 2009

Vim is a good plan. In Vim, you can simply press Ctrl+v to start visual block mode and then use any buffer manipulation commands (yank and put, etc.) as you normally would. This is a useful quick reference card if you're just getting started.
posted by sonic meat machine at 1:35 PM on January 5, 2009

Response by poster: Thanks, holding down alt worked. It didn't work in TeXnicCenter, so I just opened up the file and did it in notepad++. I'll save emacs/vim for another day.
posted by casaubon at 1:40 PM on January 5, 2009

I'm a little late to the game here, but I just wanted to mention that UltraEdit does this as well. They call it "Column Mode" (Alt+C was my favorite key combination).
posted by phrayzee at 4:51 PM on January 5, 2009

« Older What to use to get stickers off of RAM sticks?   |   Pocket Bikes in the East Bay? Newer »
This thread is closed to new comments.