1

Using the normal spell-check mechanism in vim one can jump from one misspelling to the next using ]s. Sadly vim's spell-check is completely useless for Turkish. Using the vimchant plugin that hooks into the Enchant spelling system (which in turn gets its Turkish from hunspell)* it is actually possible to get Turkish spell checking enabled in a vim buffer. However the fun and games seems to end with highlighting mismatches. The words are highlighted in the buffer but there seems to be no other smarts.

I can live without automatic suggestions, replacements etc. I can spell in Turkish when I stop to think about it. But navigating through a document fixing mistakes is painful. Even using paragraph, sentence and word motion commands it is still tedious.

Is there a way I can setup a binding to jump to the next item in the spelling mistake highlight group?

* Yes, this is turtles all the way down.

  • I take it that you could not generate a valid Turkish spell file for Vim (:h spell-mkspell) ? – VanLaser Aug 15 '15 at 17:53
  • @VanLaser No, at least not one that works worth beans. Turkish is an agglutinated language and coming up with a comprehensive word list for it is near impossible. The spell checker needs to understand bits of the grammar to have a fighting chance of being useful in the real world. – Caleb Aug 15 '15 at 17:55
  • 1
    I ask because I had problems with Romanian, and solved it. Did you try using the word list files from a recent version of hunspell or myspell? E.g. something like the dict_aff... from code.google.com/p/tr-spell/downloads/list or similar/newer/more comprehensive. – VanLaser Aug 15 '15 at 18:05
  • @VanLaser What is recent? It's probably been at least a year since I last tried that route. – Caleb Aug 15 '15 at 18:08
  • I mean, it's not clear what the problem is (is it the number of words, or the Vim understanding of grammar) – VanLaser Aug 15 '15 at 18:09
2

I will only give a beginning of an answer. First, because the vimchant plugin uses matchadd to highlight items, you can not (to my knowledge) search for SpellBad highlighted items.

One way would be to change that line to

:execute 'syntax match SpellBad "\C\V\<' . word . '\>"'

instead. Then, you can search for bad-spelling in your buffer with:

:echo synIDattr(synID(line("."),col("."),1),"name")

and moving the cursor from a word to the next one, until the result is 'SpellBad'. Automate that, and you have your answer.

Another way (better, I think), would be again to slightly modify the plugin - simply save the local variable spelling_errors to a global one (e.g. g:spelling_errors) on the following line. Then, create a function (can be in your vimrc) that searches forward, from the current cursor position, for any of the words in that list (or, alternatively, move from word to word until it finds one that belongs to the list).

I am now on Windows, and don't have an enchant executable, so I can't help more.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.