Charles E Campbell Jr wrote:
A.J.Mechelynck wrote:
Ying Bian wrote:
Vimmers,
I tried to do "nmap s :set spell!<CR>" to use "s" in normal mode
to toggle spell checker. If I run this in the interactive command line,
it is ok. But when I put this in my .vimrc, it has a tricky problem:
Although it seems to function correctly by hitting "s", every time the
cursor moves one character forward. Looks as if a <space> was sent.
I have tried to replace " " with <space> in ":set spell!<CR>" but with
on luck.
Are you sure you left no space at the end of the line, after the <CR> ?
":let @/ = ' '" will highlight all spaces (and :nohls will clear that
highlight).
You can also use ":exe 'nmap s :set invspell<CR>'" (with the single
spaces but without the double spaces) to make sure that you won't miss
any extra spaces.
Hmm, how about
:set hls
/
(that's / space)
It works but it's less obvious in an email.
(and :nohls will clear the highlighting). Alternatively,
:set list
will show ~s at the end of lines containing spaces, too.
":set list" will replace tabs by ^I (two screen cells) unless 'listchars' has
been set to include a "tab:" suboption, e.g. with
:set list listchars+=tab:\ \
which also ends in a space.
Regards,
Chip Campbell
Best regards,
Tony.