Sync typos between two Macs

5 minute read

I think every programer or writer may face this scenario, when we write some text in mac, the OS may detect typo for us. So we need train the OS to learn those new words which OS treat them as typo.


some typo dictionaries for programer

  • Mac ~/Library/Spelling/LocalDictionary
  • PyCharm .idea/dictionaries/{username}.xml

build unique LocalDictionary

The words in the dictionary file are arranged alphabetically. When your Mac scans to see if the dictionary contains a word, it stops once it reaches the point where it should be. In other words, if you put the word colour at the end of the dictionary, it will not be detected because spell check will only look up to theCs. Similarly, if you put the word Zebedee at the start of your list, spell check would stop instantly. When you are adding words to the dictionary you must be careful to keep them in alphabetical order. — PhilETaylor

Fixed with Mac level should be more generic, so read article Quick Tip: Bulk Add Words to Your Mac’s Spell Check Dictionary to build your unique LocalDictionary.

Link the directory Spelling instead of the file LocalDictionary as when you learn a new word, the symbol file will change to an ordinary file, the link will broken.

cp -r ~/Library/Spelling ~/Dropbox
cd ~/Library
rm -rf Spelling
ln -s ~/Dropbox/Spelling

Restart spell check by running killall AppleSpell, it’s better add this in your cronjob as the synced words need update the Apple cache.