textmatebundlestextmate2

How to add dictionary words for auto-completion in TextMate 2?


TextMate's Esc auto-complete is great, but it's limited by default to words only in the current document when using the Plain Text grammar. Is it possible to add standard dictionary words to this? E.g., auto-complete to "dictionary" when I press Esc after "dict"?

The old manual references completions as "an array of additional candidates when cycling through completion candidates from the current document." But I don't see how to set this up in the Plain Text bundle settings, and no references to this online. Using 2.0-beta.8.5.


Solution

  • You could use the Avian Missing TextMate2 Bundle to gain access to the "Auto-complete Across Current Tabs" command.

    You could then make and keep your_dictionary.txt open in a tab, and just add the words you wish TextMate had to that file.

    Although I haven't tested this, it stands to reason that if you opened "Auto-complete Across Current Tabs" in the bundle editor, made a copy, and change line 11:

    open_files = `lsof +D "#{project_dir}" -a -c TextMate -Fn`.split("\n").map do |line|

    to

    open_files = `cat ~/your_dictonary.txt" -a -c TextMate -Fn`.split("\n").map do |line|

    Then the script search that file even when it wasn't opened in a tab.

    IMHO: I don't think expanding this list to include every word is going to be a good idea. That's basically spell check's job.