DEV Community

Cover image for Sublime Text Shortcut Keys – Boost Productivity with Key Phrases
Stackfindover
Stackfindover

Posted on

Sublime Text Shortcut Keys – Boost Productivity with Key Phrases

In the world of coding and programming, efficiency and speed are paramount. With developers spending countless hours working on their projects, any tool that can enhance productivity is a welcome addition to their toolkit. Sublime Text, a powerful and versatile code editor, has garnered a loyal following for its speed, simplicity, and rich set of features. One of its standout features is the extensive list of keyboard shortcuts that allow developers to streamline their workflow and write code faster. In this article, we’ll explore some of the most useful keyboard shortcuts in Sublime Text and how they can revolutionize your coding experience.

What is Sublime Text?

Sublime Text is a popular cross-platform code editor known for its speed and responsiveness. Developed by Jon Skinner, it quickly gained traction among developers due to its minimalistic design, powerful features, and extensive customizability. Available for Windows, macOS, and Linux, Sublime Text offers a seamless coding experience to programmers of all skill levels.

Getting Started with Sublime Text

Installation and Setup

To get started with Sublime Text, you need to download and install it from the official website. Once installed, you can configure the settings according to your preferences, such as font size, theme, and indentation settings.

Navigating the Interface

Upon launching Sublime Text, you’ll be greeted with an uncluttered interface. The main area is the editor window, where you’ll do most of your coding. The sidebar on the left provides quick access to your project’s files, while the top menu contains various options and commands.

Essential Keyboard Shortcuts

Sublime Text’s real power lies in its keyboard shortcuts. These shortcuts keys allow you to perform complex tasks with minimal effort, significantly boosting your productivity.

File Manipulation

  • Ctrl + N (Cmd + N): Create a new file.
  • Ctrl + O (Cmd + O): Open an existing file.
  • Ctrl + S (Cmd + S): Save the current file.

Editing and Selection

  • Ctrl + D (Cmd + D): Select the next occurrence of the current word.
  • Ctrl + Shift + L (Cmd + Shift + L): Split the selection into multiple carets, allowing editing in multiple locations simultaneously.

Code Folding

  • Ctrl + Shift + [ (Cmd + Option + [): Fold the code at the current indentation level.
  • Ctrl + Shift + ] (Cmd + Option + ]): Unfold the code.

Multiple Cursors

  • Ctrl + Click (Cmd + Click): Add a new cursor at the clicked location.
  • Ctrl + Alt + Up/Down (Cmd + Option + Up/Down): Add additional cursors above or below the current cursor.

Navigating Code Efficiently

Efficient code navigation is crucial for a seamless coding experience. Sublime Text offers various shortcuts to move around your code with ease.

Moving Between Words and Lines

  • Ctrl + Left/Right (Cmd + Left/Right): Move the cursor to the beginning of the previous/next word.
  • Ctrl + Up/Down (Cmd + Up/Down): Move the cursor to the beginning of the previous/next line.

Jumping to Specific Characters

  • Ctrl + P (Cmd + P): Open the “Goto Anything” menu, allowing you to quickly navigate to specific symbols or lines.

Code Navigation with Bookmarks

  • Ctrl + F2 (Cmd + F2): Toggle a bookmark at the current line.
  • F2/Shift + F2: Jump to the next/previous bookmark.

Search and Replace Tricks

Efficiently searching and replacing text in your codebase can save you a tremendous amount of time. Sublime Text offers various tricks to streamline this process.

Finding Text

  • Ctrl + F (Cmd + F): Open the find panel to search for text in the current file.

Using Regular Expressions

  • Ctrl + H (Cmd + H): Open the replace panel with support for regular expressions.

Batch Editing with Replace

  • Ctrl + Shift + H (Cmd + Shift + H): Perform a replace across multiple files.

Code Editing Magic

Sublime Text simplifies common code editing tasks, allowing you to focus on writing code without distraction.

Duplicating Lines

  • Ctrl + Shift + D (Cmd + Shift + D): Duplicate the current line.

Commenting Code

  • Ctrl + / (Cmd + /): Toggle line comments.

Indentation Made Easy

  • Ctrl + ]/[/ (Cmd + ]/[: Increase/decrease indentation.

Supercharging Selections

Sublime Text’s powerful selection features enable you to manipulate code in bulk effortlessly.

Selecting Columns

  • Ctrl + Shift + Right/Left (Cmd + Shift + Right/Left): Expand selection to the right/left by characters.

Expanding Selections

  • Ctrl + Shift + Space (Cmd + Shift + Space): Expand selection to the scope.

Multiple Selections for Bulk Editing

  • Ctrl + Shift + L (Cmd + Shift + L): Split the selection into multiple lines, allowing bulk editing.

Advanced Customization

Sublime Text is highly customizable, allowing you to tailor the editor to suit your preferences and workflow.

Creating Custom Keyboard Shortcuts

  • Preferences > Key Bindings: Create custom keyboard shortcuts to execute commands.

Installing and Managing Packages

  • Ctrl + Shift + P (Cmd + Shift + P): Open the Command Palette and install/manage packages.

Version Control Integration

Sublime Text integrates with version control systems, enabling smooth collaboration and project management.

Git Integration

  • Ctrl + Shift + G (Cmd + Shift + G): Open the Git panel for version control operations.

Using Version Control Shortcuts

  • Ctrl + K, Ctrl + B (Cmd + K, Cmd + B): Toggle the side bar to see the changes.

Boosting Productivity with Snippets

Snippets are predefined code segments that you can insert into your code using shortcuts.

Creating and Using Snippets

  • Tools > Developer > New Snippet: Create a new snippet.

Managing Snippets Effectively

  • Tools > Developer > Snippets…: Access and manage existing snippets.

Mastering Command Palette

The Command Palette provides access to all commands and is an essential tool for efficient navigation.

Accessing the Command Palette

  • Ctrl + Shift + P (Cmd + Shift + P): Open the Command Palette.

Executing Commands and More

  • Ctrl + P (Cmd + P): Execute commands from the Command Palette.

Effective Split Editing

Sublime Text allows you to work with multiple files side by side, increasing productivity.

Working with Multiple Panes

  • View > Layout > Columns: 2: Split the editor into two columns.

Split Editing Techniques

  • Ctrl + K, Ctrl + Up/Down/Left/Right (Cmd + K, Cmd + Up/Down/Left/Right): Move file to a new pane.

Optimizing Find and Replace

Refine your find and replace techniques to speed up the debugging process.

Find and Replace with Multi-Select

  • Ctrl + D (Cmd + D): Select multiple occurrences of a word and replace simultaneously.

Find in Files – A Time-Saving Trick

  • Ctrl + Shift + F (Cmd + Shift + F): Search and replace across multiple files.

Customising Themes and Color Schemes

Personalize your coding environment by customizing themes and color schemes.

Installing and Changing Themes

  • Preferences > Color Scheme: Select and install new themes.

Tweaking Color Schemes

  • Preferences > Color Scheme > Customize: Modify existing color schemes.

FAQs

What makes Sublime Text different from other code editors?

Sublime Text stands out for its speed, simplicity, and extensive customization options. Its vast array of keyboard shortcuts and support for multiple programming languages make it a favorite among developers.

Can I use Sublime Text on multiple platforms?

Yes, Sublime Text is compatible with Windows, macOS, and Linux, allowing you to enjoy the same coding experience across different operating systems.

How do I create my own keyboard shortcuts?

You can create custom keyboard shortcuts by navigating to “Preferences” > “Key Bindings” in Sublime Text and defining your desired key combinations and commands.

Does Sublime Text support Emmet for faster HTML/CSS coding?

Yes, Sublime Text has built-in support for Emmet, a powerful tool that speeds up writing HTML and CSS code using abbreviations and shortcuts.

Can I contribute and install third-party plugins to extend Sublime Text’s functionality?

Absolutely! Sublime Text has an extensive community of developers who create plugins and packages to add new features and functionalities. You can easily install and manage these packages using the Command Palette.

Conclusion

Sublime Text is a developer’s dream, offering a plethora of keyboard shortcuts that can significantly enhance productivity. From basic text editing to advanced code manipulation, mastering these shortcuts will make you a more efficient coder. Embrace Sublime Text’s power, customize it to your liking, and watch your coding speed and efficiency soar.

All in One Shortcut Keys of Computer

Top comments (0)