Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sublime text 2 - column select till the end of the line

Tags:

Is there any way to select column with keyboard shortcut and expand selection till the end of each line?

Currently, when cursor reaches the end of the line it jumps to the beginning of the next one.

How can I avoid this behavior without using mouse?

like image 887
alexy2k Avatar asked Aug 02 '12 08:08

alexy2k


People also ask

How do I select columns in Sublime Text?

Dragging with the middle button / mouse wheel will do a column selection. You can use Ctrl and Alt with this too. Shift+Right mouse button is an alternative way to initial a column select. Dragging in the gutter (where the line numbers are), will select entire lines at once.

How do you select all occurrences of a word in Sublime Text?

To add all occurrences of the current word to the selection, use Find All: Windows/Linux: Alt+F3. Mac: ⌃+⌘+G.

How do you select a block of code in Sublime Text?

Don't know about a shortcut, but you can do CTRL+Left Click(mouse) at the beginning and end of a block. And I just noticed that you can select (highlight) a block anything and start typing, it will add your text at the beginning and end of the selected text.

How do you select all lines?

To select a line of text, place your cursor at the start of the line, and press Shift + down arrow. To select a paragraph, place your cursor at the start of the paragraph, and press Ctrl + Shift + down arrow.


1 Answers

If I've understood your question correctly, you can do that with the following keys (example with OS X keybindings):

  1. Ctrl + Shift + Up or Ctrl + Shift + Down to select a column in multiple lines.
  2. Cmd + Shift + Right (Shift + End on other OS's) to extend the selection up to the end of each line.

The related keybindings for all OS's: http://www.sublimetext.com/docs/2/column_selection.html

like image 169
José Luis Avatar answered Sep 30 '22 03:09

José Luis