简体   繁体   中英

How to toggle spell check with a keyboard shortcut in IntelliJ IDEA?

Currently I run with spell check disabled globally in IntelliJ as it ends up being more annoying than helpful most of the time. But there are many times where I'd like to quickly toggle it on and off to check the spelling of things I'm unsure of.

My current workflow in this case is to switch over to sublime then hit my toggle spell check key binding there and then jump back to IntelliJ, which isn't really ideal.

After Google searching around for it all I found was "how to disable spellcheck in IntelliJ" which I already know how to do and searching for "toggle inspection shortcut" was also unfruitful. So does anyone here happen to know if there's a way to bind toggle spell check(or toggle an individual inspection) to a keyboard shortcut in IntelliJ?

If not I might end up writing my own IntelliJ plugin today as I really really want this..

The best thing you can do with out-of-the-box functionality is using Analyze | Run Inspection by Name..., selecting "Typo" from the list and then selecting the scope to run it on.

If you want to run it with a single keyboard shortcut, you'd indeed need to write a simple plugin.

So I ended up making the plugin this late-ish afternoon in a couple hours (thank you yole for telling me it couldn't be done without a plugin before I started work on the plugin). I added the spell check toggle I wanted plus 3 custom toggle bindings that can be bound to any inspection you want.

It's currentley awaiting moderation to get in the JetBrains plugin repository but you can download the plugin jar from my website here.

And I put the source code up on GitHub here

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM