VIM spelling function -


i wan't have function turns spell check on go's next misspelled word , replaces first suggestion heres i've got far:

function! spell_new_word()   set spell=true   exe ']s'   exe '1z='   set spell=false endfunction 

but seems set spelling true , doesn't anything.... doing wrong?

update:

i've tired changing exe normal, still no luck:

function! spell_new_word()   set spell!   normal ']s'   normal '1z='   set spell! endfunction 

update 2:

i've tired , still doesn't work:

function! spell_new_word()   set spell   normal ]s   normal 1z=   set nospell endfunction 

but don't think problem think thats not binding ,d:

let mapleader = "," namp ,d spell_next_word() 

nnoremap ,d :call spell_next_word()^m 

things note:

  1. choose mode (normal mode, no remapping)
  2. include : enter command mode
  3. call function
  4. execute it! ^m normally entered c-venter on linux, or c-qenter on windows

additionally, perhaps include

inoremap ,d ^o:call spell_next_word()^m 

(again typeing ^o c-vc-o or c-qc-o)


Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -