Hi Erik!

On Fr, 20 Mai 2011, Erik Christiansen wrote:

> Now I just have to find out how to invoke the spelling suggestions.
> (After resorting to a helpgrep, I've waded through enough of the hits to
> stumble across spellsuggest(), but I need command-line functionality,
> not a scripting function.)
> 
> Oh well, trial and error works well enough, since it's usually the
> endings or glue letter in compounds which trip me up.

It is actually quite easy to find, if you know how to use Vim's help 
system. Let's see, since spelling was a new feature for Vim 7, I usually 
go to :h new-spell

There you'll find that z= is mentioned for spell suggestions. So place 
you cursor on z= and press again Ctrl-] and you'll jump right to the 
description of the z= help topic.

Now z= is a normal node command, as you want a command, you can easily 
define yourself a command, that does what you want, e.g.
:com! Spellsuggest norm! z=

Now you can use the new command :Spellsuggest and vim will invoke the 
spelling suggestion for the word under the cursor.

You can also read all about the spelling features, in the help file 
spell.txt. So :h spell.txt will give you all the glory details on how to 
use the spelling feature and how to create new spell files.

regards,
Christian

Reply via email to