惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

P
Proofpoint News Feed
F
Full Disclosure
小众软件
小众软件
V
V2EX
月光博客
月光博客
人人都是产品经理
人人都是产品经理
有赞技术团队
有赞技术团队
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
博客园 - 司徒正美
M
MIT News - Artificial intelligence
Last Week in AI
Last Week in AI
The Register - Security
The Register - Security
T
Tailwind CSS Blog
Recorded Future
Recorded Future
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
aimingoo的专栏
aimingoo的专栏
Apple Machine Learning Research
Apple Machine Learning Research
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
阮一峰的网络日志
阮一峰的网络日志
B
Blog RSS Feed
IT之家
IT之家
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
F
Fortinet All Blogs
C
Check Point Blog
云风的 BLOG
云风的 BLOG
T
The Blog of Author Tim Ferriss
雷峰网
雷峰网
GbyAI
GbyAI
Microsoft Azure Blog
Microsoft Azure Blog
Hugging Face - Blog
Hugging Face - Blog
S
SegmentFault 最新的问题
V
Visual Studio Blog
J
Java Code Geeks
Y
Y Combinator Blog
A
About on SuperTechFans
Blog — PlanetScale
Blog — PlanetScale
美团技术团队
Vercel News
Vercel News
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Stack Overflow Blog
Stack Overflow Blog
I
InfoQ
H
Help Net Security
MongoDB | Blog
MongoDB | Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
Engineering at Meta
Engineering at Meta
Martin Fowler
Martin Fowler
The Cloudflare Blog
博客园 - 三生石上(FineUI控件)
D
Docker
The GitHub Blog
The GitHub Blog

Keenformatics

Using Tox with Poetry dependency groups PyLaDe Ports blocked by browsers Manually verifying an SSL certificate How to generate documentation with Sphinx How To Find out Sublime Text Key Binding Commands How To Make Terminator Behave Like Guake (Ubuntu) Sentiment Analysis lexicons and datasets Model-Driven approach vs hardcore coding
How To Override Sublime Text Packages Shortcuts and Preferences
fievelk · 2016-10-20 · via Keenformatics

I recently began using a Sublime Text 3 package that automatically generates inline YARD documentation for my Ruby code (Yardgen). The only problem with this package is that the key bindings it provides are overriding other Sublime Text shortcuts that I want to keep.

Since this plugin is packed in a zip file, it is not possible to simply edit one of its keymap files (see Package Control - Customizing Packages). At the same time, unpacking the original zipped file and creating a new zip file would not work.

Following are the steps that you need in order to solve this problem and, more generally, to override Sublime Text 3 packed packages preferences.

NOTE: If your package is overriding some default binding you wanted to keep, but you do not know the command it was binded to, please refer to my previous post.

The steps!

Install your package (Yardgen, in my case) using the Package Manager or any other method you prefer.

Your zipped package file should be now placed within the folder ~/.config/sublime-text-3/Installed Packages/<your-package>.sublime-package.

Check the content of the package by unzipping it (just make sure to keep the original zipped file).

In my case I want to edit one of the default Yardgen keybindings. Key bindings for Linux are usually stored in the Default (Linux).sublime-keymap file within the Yardgen package archive. This is the file content:

[
  { "keys": ["ctrl+enter"], "command": "yard_gen"},
]

We now have to create a folder named Yardgen inside ~/.config/sublime-text-3/Packages. We can then place inside it our new key bindings file that will override the default package behaviour:

cd ~/.config/sublime-text-3/Packages
mkdir Yardgen
gedit "Default (Linux).sublime-keymap"

Now copy the following json content in Default (Linux).sublime-keymap:

[
    { "keys": ["ctrl+alt+shift+enter"], "command": "yard_gen"},
]

As you can see, we just associated the yard_gen command to a different key sequence. You can obviously choose the one that best suits your needs.

At the moment, the yard_gen command is binded to two different key sequences: the default one, still present in the original package, and the new one we just defined. In my case, I’m not ok with this. Yardgen key bindings have in fact overridden the default CTRL + Enter behaviour, and I want to have it back.

If you too want to restore the default binding, you just need to figure out which command it was originally associated with and then explicitly add its binding to the Key Bindings preference file. For more details, please refer to my other post: How To Find out Sublime Text Key Binding Commands.

References