Monday, December 2, 2013

How to add a line break at the end of a bunch of lines in Sublime Text editor

I found the solution (copied below) here:
http://stackoverflow.com/questions/14509001/shortcut-to-paste-multiple-lines-sublime-text-2

The solution was posted by Rachel Gallen, a web designer in Ireland.
Ctrl+C, Ctrl+X and Ctrl+V let you copy/cut/paste lines if you don't select anything. So, Ctrl+X doesn't "delete" a line, it cuts it. To delete a line, the default shortcut is Ctrl+Shift+K :)

Highlighting a bunch of lines then hitting Cmd (Ctrl?) +Shift+L gives you multi-cursors on each line. I do that, followed by Cmd + Right arrow (End?) to get easily get a cursor at the end of a series of lines to simultaneously type something after each.

Ctrl+Shift+J expands the selection to the indentation level of the current line. So if you want to select a block of code with the same indentation it's really useful. 

Alt + F3 select all occurrences of current word for multiple editing. Very useful.  A few written about in more detail: http://whiletruecode.com/post/7-handy-text-manipulation-tricks-sublime-text-2