Bread+Crumbs

bits & bites from the world of code

10 Sublime Commands to Memorize…NOW

Mar
15
2015

In web development, productivity is the name of the game.

Time, after all, is money. And like most things in life, the clock started five minutes ago.

The seconds are ticking… how we can ensure we’re maximizing every minute?

Well, some people (non-developers, mostly) think that if we all just think quickly, problem solve quickly and code quickly, then we’ll complete projects quickly, right?

Maybe…but only in a dream world.

In the real world, web development isn’t so cut and dry. As developers, our workflow more often resembles a windy, uneven road filled with crater-like potholes and big orange detour signs rather than a flat, newly paved, empty racetrack.

Roadblocks arise and they arise more often than we’d like to admit.

Therefore, given all of the unknowns that can appear during the development process, it’s increasingly important to maximize those tasks that we do have control over. One of the most important of those tasks being how we move throughout our dev environment.

Become a master of the keyboard

While it may appear that a little mouse action and a few clicks only take a few seconds, those seconds quickly add up.

Based on my personal experience, I’ll recommend 10 Sublime shortcuts that I believe to be the most helpful for any new web developer wanting to maximize their time. These are shortcuts I use daily and as a result have noticed significant improvement in how I’m able to manage my projects, my time and my code.

Let’s get started…

A quick note…if you are running other programs that require shortcuts, you may need to finagle some of your preferences to ensure the commands below work as expected.

The Commands

Print these off (download a printable pdf) and tape them to your computer screen, make flashcards, or type them on a sticky note. Do whatever works best for you, but use them and engrain them into your mind.

  1. Cmd + Shift + p — need to install a new package or search for a snippet? Use this command. It’s also great for setting your doc type…just type in the file extension you need, such as html, and you can set your doc type without needing to use your mouse.Sublime_shortcuts
  2. Cmd + Shift + f — a coworker pointed this command out to me, for which I’m incredibly grateful. Unlike cmd + f (which is also great), this shortcut allows you search the entire list of files you have open. This is especially useful when you’re working with someone else’s code and you aren’t familiar with their naming conventions or placement of code blocks.
  3. Cmd + d — need to change a word? How about several instances of that word? Instead of going line by line, use this command to select one word and continue pressing the letter d  to highlight each instance thereafter.
  4. Cmd + l — similar to selecting a word, this command lets you select an entire line. Again, rather than using your mouse to highlight the section you need, just two keyboard strokes and you can select the entire row.
  5. Shift + arrow left/arrow right – this command often coincides with cmd + d. At times, while you may want to select a word, sometimes you also want to select text that comes after that word as well. This command allows you select any additional letters one at a time.
  6. Cmd + k + b — while a somewhat odd combination of keys, this command is exceptionally useful when you want to maximize your screen space. If you have a sidebar open in sublime but want to hide it, this command will do just that. Each time you use this combo of keys, it will toggle the sidebar…making it easy to adjust your text editor view.
  7. Cmd + shift + v — if you copied a snippet of text from another file and need to paste it someplace else, you might find that your formatting becomes out of wack. Instead of manually re-tabbing all of your content, you can use this shortcut to paste your code as it should be formatted.
  8. Cmd + option + arrow left/arrow right — if you have several Sublime windows open at once, you’ll probably want to toggle through them at some point. This allows you to move from one to the next easily and quickly.
  9. Cmd + option + 2 — this useful shortcut allows you to split your Sublime screen into 2, which is great when you need to reference another file. You can use this command with any number from 1 to 5, although I find that I use 1 and 2 most often.
  10. Ctrl + cmd + arrow up/arrow down — this will allow you to move a line of code either up or down in your text editor.

Once you master these commands, don’t stop! There are plenty more shortcuts that will help improve your workflow. The less you need to rely on your mouse, the quicker you’ll code.

BUT, don’t feel you need to memorize all of the commands that exist. Find the ones that will be most useful for you and make a conscious effort to learn them.

Remember, even though you might not be able to control everything that happens during your coding adventures, you can control how quickly you navigate through your files.