Wes Bos

Designer, Developer & Entrepreneur making the web an awesome place.

linebubble.mov

As I’ve been writing the Sublime Text Power User book over the last few months, I’ve had some interesting conversations around favourite features of ST. The one feature that I constantly surprise people with is called line bubbling – moving lines of code up and down a document without cutting and pasting them.

linebubble.mov

It’s an extremely simple feature but will save you lots of time and potentially lost code.

Let’s take this list as a very basic example. This list could be any block of code that you want to move up or down – they are only numbered as a visual.
ss 2013-03-11 at 11.14.30 PM
How do we move them up and down to end up in the correct order? We could cut and paste, but line bubbling is much faster.

In Sublime Text, hold down + control (CTRL + SHIFT on Windows) and use your ↑ up* and ↓ down arrow keys to move the lines around. This works for single and multiple lines.

Check out the video for a visual:

Easy! Want to learn more, sign up below and I’ll let you know when my book comes out.

Let me know when this book launches

Enter your email address below and I’ll give you a hoot when its ready plus a discount code for being so great!

This entry was posted in Sublime Text, Text Editors. Bookmark the permalink.

4 Responses to Learn Sublime Text line bubbling in 2 minutes ☰

  1. Woody says:

    I find this feature coupled with duplicate (ctrl+shift+d) really powerful for duplicating and then repositioning.

  2. jenny says:

    omg, you are my hero for this (ps where do you know all this from? googling sublime shit somehow seems ridiculously disproportionately unhelpful compared to googling other shit..your book will go well used)

    • Kajo says:

      @jenny: Quick tip – look up “Preferences/Keybindings – Default”, look into the file and if questions are coming up, search from there. It’s so much faster :-)

  3. tanura says:

    omg i never know this shortcut before. thank you man

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>