Hunspell dictionaries support
PhpStorm is a polyglot IDE: it understands PHP, JS, CSS, HTML, and many other languages and will provide you with smart interpretation to assist you with writing your code. But what about human languages? English is the only language supported out of the box, and up until recently, you could only check your spelling in PhpStorm against a plain list of words.
This changes with PhpStorm 2017.3.2, since we are introducing support for Hunspell dictionaries.
Chances are that you are already using Hunspell, though without even realizing it: It is the built-in spell checking engine used in OpenOffice, Mozilla Firefox, Google Chrome, Opera, macOS and many others – now including PhpStorm.
Compared to a plain list of words, Hunspell provides significantly faster and much more accurate typo detection with far fewer false positives.
Hunspell uses its own dictionary format, with each dictionary comprising two files. These files are commonly stored in the same directory and share the same name, for example, en_GB.dic and en_GB.aff. The .dic file stands for “dictionary”: it contains a list of words together with the applicable modification rules. The .aff file stands for “affixes”, which are, basically, prefixes and suffixes regulated by a specific rule:
The files’ content is stored as plain text. Should you want to modify a dictionary or even create your own from scratch, you can do it using any text editor. Creating your own dictionary is a task in itself, and there are multiple guides available online. This one, for example, contains everything to get you up and running with your own dictionary.
In the majority of cases, however, downloading a ready-made dictionary online is more than enough to fulfill one’s spell-checking needs. These resources may provide you with a good start for finding a dictionary:
Having downloaded the dictionary, store it in a folder of your choice so that you can locate it from PhpStorm.
Setting up a Hunspell dictionary in PhpStorm
Hunspell dictionaries in PhpStorm are supported via the bundled Hunspell plugin. To make sure that it’s installed and enabled (as well as to install and enable it otherwise), navigate to Settings/Preferences | Plugins:
The next step is to appoint a Hunspell dictionary to be used by the spell checking engine. Navigate to the Settings/Preferences | Editor | Spelling, switch to the Dictionaries tab and select the dictionary folder:
With the dictionary in place, PhpStorm will provide you with everything you would expect from a spell checking system: it will detect and highlight typos in your text and propose corrections for them.
Stay tuned for more updates!
Your JetBrains PhpStorm Team
The Drive to Develop
Subscribe to Blog updates
Thanks, we've got you!
Qodana Clone Finder: Early Access Program
In December 2020, we announced the EAP for Qodana, which is rapidly evolving into a comprehensive platform that allows companies to perform multi-level evaluations of the quality of code they own, contract, or purchase. Qodana helps you detect bugs without relying on an IDE, either on a local machi…
PhpStorm 2020.2 EAP #3
The Early Access Program for PhpStorm 2020.2 is in full swing and today we’ve got the third build of the 2020.2 EAP for you. In this blog post, you can read about improvements for Git installed in WSL2 and Search Everywhere. Download PhpStorm 2020.2 EAP (more…)…
PhpStorm 2019.3.3 Preview
We’ve just rolled out a preview for the third minor update for PhpStorm 2019.3. Please give the PhpStorm 2019.3.3 Preview build 193.6494.5 a try and share your feedback with us. (more…)…
How to Upgrade to PHP 7.4 with PhpStorm
Check out our fresh video with a few nice tips and tricks on how to update your codebase to PHP 7.4. It combines materials from the PhpStorm 2019.2 and PhpStorm 2019.3 releases, with a few cool bonuses to boot. Nikita drew our attention to the fact that setters are slower than assigning prop…