![sublime 3 shortcuts keyboard sublime 3 shortcuts keyboard](https://generalassemb.ly/blog/wp-content/uploads/2013/11/sublime-groups.png)
Having nice, legible code depends to large extent on the formatting of the code. These two shortcuts have saved me a lot of energy that would have been wasted copying/pasting and using the trackpad to highlight text. Same as the last shortcut, but moving in the opposite direction. Control + Command + Down Arrow = Move Line Down Just highlight the lines you want to move, or make sure the cursor(s) is/are on the line(s) you want to move. Great for quickly moving one or more lines up the page.
![sublime 3 shortcuts keyboard sublime 3 shortcuts keyboard](https://www.sublimetext.com/screenshots/3.2/git_diff@2x.png)
Control + Command + Up Arrow = Move Line Up For this one to work, be sure that no text on the screen is highlighted, then hold Alt down, and finally drag the mouse over the desired text. Alt + drag mouse is the right tool for the job here. Sometimes you want to get a cursor in the same column on 10 consecutive lines, or you want to select a 3 x 8 rectangle of text. This one is cool, though admittedly I do not use it as often as the above shortcuts. Alt + Drag Mouse = Select Rectangle with Multiple Cursors As with the previous shortcut, Sublime Text has great fuzzy matching for search queries, so you can find the file you’re looking for as easily as possible.
![sublime 3 shortcuts keyboard sublime 3 shortcuts keyboard](https://www.madhankarthik.in/wp-content/uploads/2018/06/keybinding-750x314.png)
Command + t lets you keep your hands on the keys by opening up a search bar to help you find the file you’re looking for. Navigation between files can get a bit tricky when in a big project like a Rails app, and it’s easy to fall back on using the mouse to click through folders and open new files. This is awesome if you are just sketching out some ideas in a file that you haven’t saved yet (on second thought, you might want to save that file!) or if you’re working in a bin or other file that doesn’t have an extension. The search functionality in Sublime Text is great at matching fuzzy queries, so if you just type “ssr” then hit Enter, the text in your file will have Ruby’s syntax highlighting. Enter “ss” when the search bar pops up to jump down to the various “Set Syntax” options. This shortcut actually opens up the Command Palette – a menu that includes a number of things like package controls and preference settings. Command + Shift + p = Set Syntax Highlighting Now, we could probably do some refactoring here, but that’s another blog post! 7. If the keys of the hash happen to be named the same as the keys of the class’s attributes, then there is no need to type these out twice! If you start out withĭef import_dog_characteristics ( hash ) self. In Ruby, you might be setting several attributes of a class to values from a hash. As with the previous shortcut, this gets really powerful when combined with other keyboard shortcuts, like copy/paste. To get this to work, all you have to do is keep pressing the Command key and highlight different regions of text with the trackpad. This one is similar to the Command + d, but is not restricted to highlighting repetitions of the same text. Command + Highlight Text = Multiple Select of Different Words This is the first demo on the Sublime Text website – check it out if you haven’t yet! 6. What’s really cool about this is that Sublime gives you a cursor for each highlighted block of text! That means when you change the highlighted text in what you think should be one place, all of the highlighted texts change. I could do a global replacement with Command + Shift + f, but if I want to do a more fine-grained change and have more control over exactly what I’m highlighting and editing, I go with Command + d. Let’s say I’m refactoring my code and I decide to change the name of a method. Command + d = Multiple Select of the Same Word Control + Shift + k = Delete Current LineĪlso straightforward, and a more efficient version of “the number one tool for improving code.” 5. Simply duplicates the line you call the command on and places the new line below. Command + Shift + d = Duplicate Current Line Command + Shift + Enter has saved me many times here. a Ruby file)Īnd then immediately realize I want to write the body of the method. It’s perfect if you write a couple of lines at the top of a file (e.g. I didn’t realize how much I needed this shortcut until I started using it. Command + Shift + Enter = New Line AboveĪ slight modification of the above, and an insanely useful shortcut. This shortcut has saved me a lot of energy – instead of worrying about where the cursor is on a line when hitting Enter, I only need to make sure that the cursor is on that line. Gone are the days of pressing Enter and accidentally cutting a line in half, then having to undo, then having to figure out a way to get the cursor to get to the end of the line before hitting Enter again. I do almost all of my coding and blogging in Sublime, and as such there are a few convenient keyboard shortcuts I’ve picked up along the way.
SUBLIME 3 SHORTCUTS KEYBOARD SOFTWARE
Like many software developers, Sublime Text is my preferred text editor. My Favorite Sublime Text Keyboard Shortcuts