Here's the function I created. " F7 Will give some spelling suggestions for the current word in any mode nmap \ss vmap \ss omap \ss map! \ss noremap \ss :call SuggestWord() "Make some spelling suggestions for the current word, and allow you to change it for the word you prefer "Requires ispell and perl "By Ben Staniford function! SuggestWord () let rw = tempname() let oldspelling = expand("") "Run ispell on the word under the cursor and prompt us for a choice, then save it to a temp file exe '!echo -n '.oldspelling.' | ispell -a -S | perl -e '."\x27".'print "
";'. \ 'while(<>) {if(/.*:\s(.*$)/){$m=1;@a=split ", ",$1;print "Suggestions: [CTL-C to abort]
";'. \ 'for (@a) {print ++$i.")$_ "} print "
>"; open (I, "/dev/tty"); $b=; open(RW,">'.rw.'");'. \ 'print RW "$a[$b-1]";}}if($
Attributes | Values |
---|
rdfs:label
| - Spelling suggestions anywhere, even in console mode
|
rdfs:comment
| - Here's the function I created. " F7 Will give some spelling suggestions for the current word in any mode nmap \ss vmap \ss omap \ss map! \ss noremap \ss :call SuggestWord() "Make some spelling suggestions for the current word, and allow you to change it for the word you prefer "Requires ispell and perl "By Ben Staniford function! SuggestWord () let rw = tempname() let oldspelling = expand("") "Run ispell on the word under the cursor and prompt us for a choice, then save it to a temp file exe '!echo -n '.oldspelling.' | ispell -a -S | perl -e '."\x27".'print "
";'. \ 'while(<>) {if(/.*:\s(.*$)/){$m=1;@a=split ", ",$1;print "Suggestions: [CTL-C to abort]
";'. \ 'for (@a) {print ++$i.")$_ "} print "
>"; open (I, "/dev/tty"); $b=; open(RW,">'.rw.'");'. \ 'print RW "$a[$b-1]";}}if($
|
Version
| |
dbkwik:vim/property/wikiPageUsesTemplate
| |
Previous
| |
Category
| - Integration
- Spell Checking
|
Author
| |
Complexity
| |
Created
| |
ID
| |
NEXT
| |
Rating
| |
abstract
| - Here's the function I created. " F7 Will give some spelling suggestions for the current word in any mode nmap \ss vmap \ss omap \ss map! \ss noremap \ss :call SuggestWord() "Make some spelling suggestions for the current word, and allow you to change it for the word you prefer "Requires ispell and perl "By Ben Staniford function! SuggestWord () let rw = tempname() let oldspelling = expand("") "Run ispell on the word under the cursor and prompt us for a choice, then save it to a temp file exe '!echo -n '.oldspelling.' | ispell -a -S | perl -e '."\x27".'print "
";'. \ 'while(<>) {if(/.*:\s(.*$)/){$m=1;@a=split ", ",$1;print "Suggestions: [CTL-C to abort]
";'. \ 'for (@a) {print ++$i.")$_ "} print "
>"; open (I, "/dev/tty"); $b=; open(RW,">'.rw.'");'. \ 'print RW "$a[$b-1]";}}if($m\!=1){print "No Suggestions
"}'."\x27" "If the user selected a word and it was saved, read it now if filereadable(rw) exe 'read ! cat '.rw exe "normal \"adw" exe "normal ddk" exe "normal /".oldspelling."\" exe "normal cw" "Print the word slightly differently if we're at the beginning of a line if (wincol() == 1) exe "normal \"aP" else exe "normal \"ap" endif endif endfunction "SuggestWord()
|