12 Keyboard shortcuts every programmer should know.

One way to becoming a more productive programmer is to keep you hands on the key board and I know there are a lot of you out there saying well just use VIM. Sorry not quite there yet, until I am these shortcuts help out a lot. I apologize in advance these are all Mac and sublime commands. I believe on windows you can replace ⌘ with the ‘ctrl’ key for most of these but not 100% sure. And for the sublime commands I know most of these work with Atom as well.

⌘ + Tab

I’m sure everyone knows about this one. But there are a few things that make it a little better. After you press ⌘ + Tab continue to hold down the ⌘ key and you can take over with your → and ← arrow keys and when you get to the program you are looking for you can either release the ⌘ key to open that app or press ↓ and it will show you all the windows you have open or minimized in that app. You can also achieve the same thing by pressing control+↓ when you currently have that app in focus.

⌘+→ ⌘+←

This a handy tool that will depending on which arrow you press take you to the (←)beginning of the line or the (→)end of the line. An added feature to this if you hold shift while doing it, it will select everything from where your cursor is to the beginning/end of the line.

option+→ option+←

Similar to ⌘+→ but possibly more useful this will move your cursor to the next breakpoint in the line. Some examples of breakpoints are spaces and most special characters (e.g. ! . ‘ “). Once again if you hold shift while doing this you can select the word/s your looking to select a bit quicker.

⌘+option+→ ⌘+option+←

This is useful for navigating through your sublime tabs. By pressing ⌘+option+← you can open the tab to the left and open the tab to the right with ⌘+option+→. In my opinion this is only really useful when you have 11+ tabs open because there are faster ways with fewer tabs see below.

⌘+[0–9]

Now lets say you have less than 11 tabs open in your SublimeText. Using the arrow method mentioned above would be tedious however you can use ⌘+[0–9] and the number you press will open the tab in that position which is why it only works for a max of 10 tabs. If you are using multiple panes in your text editor this will only work for the side that you are currently working on.

⌘+option+[1–5]

This is a handy shortcut but for how little you really need to use it not one of the more important ones. ⌘+option+[1–4] will make 1, 2, 3 or 4 vertical columns (also known as panes) in your SublimeText, while ⌘+option+5 will make 4 squares in the corners. Also if you wanted horizontal rows instead of columns you can use ⌘+option+shift+[2–3].

control+[1–4]

After you are using multiple panes this is a very useful shortcut. With this you can toggle focus to another pane. For instance if you run 3 columns maybe HTML in column one, JavaScript in column two and CSS in column three and your working on your CSS and you realize you need to add a class in your html you can press control+1 to toggle focus and make a quick change.

⌘+d

Is select next and is an awesome shortcut. If you have a word, letter or sentence selected pressing ⌘+d will select the next one while keeping your current selected.

⌘+shift+f

This shortcuts is useful for two reasons, technically it’s find and replace so if you wanted to find every word and replace it with another this can be useful. However I usually use if for a different reason. If you just enter a value in the find field with nothing in the replace field and press enter it will show every file that has that value and a preview of where it’s at if you click the path of the file it will open.

⌘+`

This will toggle the focus if you have more than one window open in a specific application. It’s kinda like ⌘ + Tab except for rather than switching applications it switches windows.

⌘+enter

Will enter a new line below the line your are currently working on, but the best part is that your cursor can be in the middle of a sentence and will not break the sentence just go to the next line.

⌘+/

Can comment out a single line or if you have multiple lines selected can comment out multiple lines.

⌘+{ ⌘+}

Can indent a single line or if you have multiple lines selected can indent multiple lines.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store