How can I customize keyboard shortcuts in Sublime Text?
Jul 02, 2025 am 12:25 AMYes, you can customize keyboard shortcuts in Sublime Text by editing the user key bindings JSON file. 1. Access Preferences > Key Bindings to open the configuration file, always editing the right pane for customizations. 2. To add a new shortcut, identify the command and key combination, then insert a valid JSON object like { "keys": ["ctrl+alt+t"], "command": "insert_snippet", "args": {"contents": "This is my template text"}}. 3. Override or remove existing shortcuts by copying the default binding, pasting it into your user settings, and either changing the command or setting it to an empty string. 4. Test changes instantly without restarting, checking for errors in the console (Ctrl+`), conflicting plugins, or OS-level interferences if a shortcut doesn’t work as expected.
Yes, you can definitely customize keyboard shortcuts in Sublime Text — it's pretty flexible that way. The key is editing the right configuration file and knowing how to structure the commands properly.
Where to Find and Edit Shortcut Settings
Sublime Text stores keyboard shortcuts in a JSON file. You can access it by going to Preferences > Key Bindings. This will open two panes: the left shows default shortcuts (read-only), and the right is where you make your customizations.
To add or change a shortcut:
- Always edit the right pane
- Make sure the syntax stays valid JSON
- Use the exact command name and arguments if needed
A common mistake is copy-pasting from defaults without adjusting for personal needs — don’t forget to double-check brackets and commas.
How to Add a New Shortcut
Let’s say you want to create a shortcut that inserts a frequently used snippet. Here's how:
- Know the command you want to bind — maybe
insert_snippet
- Decide on the key combination (like
ctrl+alt+t
) - Add something like this to your user key bindings:
{ "keys": ["ctrl+alt+t"], "command": "insert_snippet", "args": {"contents": "This is my template text"} }
You can also trigger custom plugin commands this way, as long as you know what they’re called. If something stops working after adding a new shortcut, check for conflicts or invalid formatting.
Overriding or Removing Existing Shortcuts
Sometimes you might want to disable a default shortcut or assign it somewhere else. For example, if you find Ctrl+S
isn't doing what you expect because of another plugin, you can override it.
To remove a binding:
- Copy the original key binding from the left pane
- Paste it into your user settings
- Replace the
"command"
with""
(empty string)
Example:
{ "keys": ["ctrl+s"], "command": "" }
Or to reassign it to a different action:
{ "keys": ["ctrl+s"], "command": "save_as", "args": {} }
Be careful not to block essential functions unless you're sure about it.
Testing and Troubleshooting Your Changes
After saving changes, Sublime Text applies them instantly — no restart needed. But sometimes things don’t work as expected.
If a shortcut doesn’t do anything:
- Check the console (`Ctrl+``) for errors
- Make sure there are no conflicting plugins or duplicate key combinations
- Try simpler key combos first for testing
Also remember that some OS-level shortcuts or other apps might interfere, especially on macOS with system-wide gestures or Windows with input method switches.
That's basically how it works — just edit the right file, use correct syntax, and test as you go. It’s not complicated once you get the hang of it.
The above is the detailed content of How can I customize keyboard shortcuts in Sublime Text?. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undress AI Tool
Undress images for free

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Most users can save time using the system by using keyboard shortcuts. These shortcuts can be used to open the Run Command box, open File Explorer, activate Setup, lock the screen, and more. There are several ways to quickly restart or shut down your Windows operating system. Sometimes a mouse breaks and using the touchpad on your laptop can make tasks that can be done quickly using shortcuts feel unpleasant. If you're wondering how to shut down or restart your computer using keyboard shortcuts, this article will show you how to do it in three different ways. Restart and shutdown keyboard shortcuts using the Start button context menu Step 1: To open the context menu of the Start button on the taskbar, simultaneously press Windo on your keyboard

Adobe Photoshop is the industry standard for digital design, loved and used every day by the online community. However, when keyboard shortcuts stutter or fail entirely, it can significantly slow down any project or your overall productivity on Windows 11. Whether you're an experienced designer or just dabbling in photo editing, these glitches are more than just minor annoyances in Photoshop and Photoshop CC. First, let's look at the common reasons why custom or default shortcuts stop working. Why don't my shortcuts work in Photoshop? Customize workspace settings: Sometimes, adjusting or switching between workspace settings can reset keyboard shortcuts. Sticky Keys: This accessibility feature

alt+a is a shortcut key used to access and trigger different functions and options. Common functions in different scenarios: 1. Use in browsers, used to access and use the browser's menu bar options; 2. In Windows Used in operating systems, usually appearing on buttons in dialog boxes or windows, used to trigger the command or operation represented by the button; 3. Used in text editing and processing software, often used as shortcut keys for text operations; 4. When used in applications, it is usually used to access menu bar options, execute common commands, or initiate specific operations.

When we use win7 system, we always use various keyboard shortcuts. Today we bring you the most comprehensive method of using win7 shortcut keys. Let’s take a look at the specific usage methods. How to use win7 system keyboard shortcuts 1. Ctrl shortcut key Computer demonstration of common shortcut keys in win7 Ctrl+S Save Ctrl+W Close program Ctrl+N Create a new folder Ctrl+O Open Ctrl+Z Undo Ctrl+F Find Ctrl+X Cut Ctrl+C Copy Ctrl+V Paste Ctrl+A Select all Ctrl+[Reduce text Ctrl+] Enlarge text Ctrl+B Bold Ctrl+I Italic Ctrl+U Underline Ctrl+Shift

How to view keyboard shortcuts in MacOS Ventura Open the ? Apple menu and select System Settings Select "Keyboard" from the list on the left Click "Keyboard Shortcuts" to view keyboard shortcuts System Settings panel Now to view all keyboard shortcuts or applications Shortcuts, select "App Shortcuts" from the sidebar list. Click the tiny light gray > symbol next to "All Apps" to expand the list of key combinations and make them all visible at once. Now you can see what you might Any keyboard shortcuts that have been added, such as the Save as PDF shortcut or other custom keyboard shortcuts. The animated GIF in this article demonstrates how to actively show and hide App Shor

Some users find that their Windows 7 computers do not have a run key and are not sure where to find it. We can use the shortcut key win+R to quickly find and open the run window. You can also search directly in the input box of the computer. If the user is in the menu bar If you don't find the run option, open the properties page, check the run command and then save it, so that you can easily find the run. Windows 7 does not have a run key solution 1. Shortcut key method: win+R (this is the simplest when running an application, the Windows logo key is between the left Ctrl and left Alt keys) 2. Click the start menu bar and enter in the input box "Run", query the search results and find that there is running in the results, click Run to complete 3. Right-click

The Windows logo key, also known as the Windows key, is a special key that we often see on computer keyboards. As the symbol of the Windows operating system, the Windows logo key plays an important role when using the computer. So, which key is the Windows logo key actually? Let us learn more about it next. The Windows logo key is usually located at the bottom center of the keyboard and is often marked by a prominent Windows icon. This specially marked key is generally rectangular

To customize Mac keyboard shortcuts, first open the keyboard shortcut interface in system settings. The specific path is: System Settings → Keyboard → Shortcuts tab; secondly, click the " ” in "AppShortcuts" to add command shortcuts to modify specific applications, enter the exact command name displayed in the menu bar and set a new combination; finally, if you need more complex functions, you can use third-party tools such as Karabiner-Elements or BetterTouchTool to achieve deep customization. When setting, please note that the command name must be accurate, and permissions and conflict issues must be checked to ensure that it takes effect.
