I wan’t to have a function that turns spell check on then go’s to the next misspelled word and replaces with the first suggestion heres what I’ve got so far:
function! Spell_new_word()
set spell=true
exe ']s'
exe '1z='
set spell=false
endfunction
but it only seems to set spelling to true and doesn’t do anything…. what am I doing wrong?
UPDATE:
I’ve tired changing exe to normal, but still no luck:
function! Spell_new_word()
set spell!
normal ']s'
normal '1z='
set spell!
endfunction
UPDATE 2:
I’ve tired this and it still doesn’t work:
function! Spell_new_word()
set spell
normal ]s
normal 1z=
set nospell
endfunction
But I don’t think that is the problem I think thats its not binding to ,d:
let mapleader = ","
namp ,d Spell_next_word()
things to note:
:to enter command modecallthe function^Mis normally entered with C-vEnter on linux, or C-QEnter on WindowsAdditionally, perhaps include
(again typeing the
^Oas C-vC-o or C-QC-o)