如何在Sublime Text 3中重映射EmacsProEssentials包的撤销快捷键?
I’ve dealt with similar shortcut customization needs before, and Sublime Text’s user-level config is the way to go here—modifying the package’s own files will get overwritten when the package updates, so we’ll use the safe, persistent method:
Open your user key bindings file
Launch Sublime Text 3, then go toPreferences > Key Bindingsfrom the top menu. This will split your editor into two panels: the left shows default system/package shortcuts, and the right is your personal custom key bindings file (this is the one you’ll edit).Identify the target command
First, you need to know exactly which command the brokenctrl+\shortcut is triggering. You can either:- Use the search bar (Ctrl+F) in the left default bindings panel to look for
"ctrl+\\"and note the corresponding"command"value (it’s likely something like"undo"or a package-specific command like"emacs_undo"). - Or, press
Tools > Developer > Show Key Bindingsfrom the menu, then press the problematicctrl+\shortcut—this will show you the exact command it’s mapped to.
- Use the search bar (Ctrl+F) in the left default bindings panel to look for
Add your custom binding
In the right panel (your user key bindings), add the following JSON snippet (make sure it fits properly within the existing[]brackets, and fix any commas if needed):// Remap Emacs-style undo to ctrl+/ {"keys": ["ctrl+/"], "command": "undo"}, // Optional: Disable the original ctrl+\ shortcut if you don't want it anymore {"keys": ["ctrl+\\"], "command": "noop"}Replace
"undo"with the actual command you found in step 2 if it’s a package-specific one. Thenoopcommand simply makes the original shortcut do nothing, so it won’t conflict with your new binding.Save and test
Save the user key bindings file (Ctrl+S), then close and reopen Sublime Text to ensure the changes take effect. Now pressingctrl+/should trigger the undo action just like you expect in Emacs.
内容的提问来源于stack exchange,提问作者Ray Salemi

