MS Word from VIM : Interact with MS Word from VIM
| script karma
Downloaded by 1084
Comments, bugs, improvements
script versions (upload new version)
|To interact with Microsoft Word from VIM
Currently supports use of Word's Thesaurus and Speller
Copyright (C) 2004 Suresh Govindachar <initial><last name><at><yahoo>
Windows (with MS Word)
VIM with embedded perl support
The perl module Win32::OLE (good way to get this is to have external perl)
The following four commands are exported to the end-user:
In regard to the first three commands:
- Each command can be issued with no arguments or with one argument.
When no argument is provided, the <cword> (see :help cword) is
used as the argument.
- After execution, the "result" is appended below the current line.
- The "result" for the Thesaurus command is all
the synonyms and the antonyms.
- The "result" for the Spell command is all
the spelling suggestions.
- The "result" for the Anagram command is all
the anagrams of the given letters.
Try the following:
In regard to the fourth command (:<range>WordCheckSpelling):
- The default range is the whole buffer -- in order for
quickfix commands to work, there has to be a file
associated with the buffer.
- Results are:
- highlighting as Error each misspelled word in the range
(the filetype is set to nothing so that the only colored
stuff are the misspelled words)
- ability to use the quickfix commands (:cfirst, :cn, etc) to
visit each misspelled word and to look at suggestions on spelling it.
- Sub commands (of the :<range>WordCheckSpelling command):
Highlights misspelled words (there won't be any other highlighting)
Restores highlighting based on filetype
The next five commands extend the corresponding quickfix
commands (:cfirst, :clast, :cc, :cn, :cp) by
loading the search register with the appropriate
- Optional (controlled by g:no_plugin_maps or g:no_word_maps)
Windows 98 with Word 97 (and Vim 6.3, ActiveState's perl 5.8).
Anagram and WildCard NOT supported by Microsoft in later versions of MSWord -- see
Sometimes Windows and/or Word is sluggish and things
time-out with a "no service available" or some such
error message -- when this happens, just reissue the command.
Although I conceived and developed this plugin, I
learnt how to interact with Microsoft Word for
accessing its Thesaurus and Spelling from:
- Chad DeMeyer (microsoft.public.word.word97vba)
- Steven Manross (perl-win32-users@listserv.ActiveState.com)
- Greg Chapman (perl-win32-users@listserv.ActiveState.com)
The material provided here is provided as-is without any warranty --
without even the implied warranty of merchantability or fitness for a
particular purpose. The author assumes no responsibility for errors or
omissions or for any sort of damages resulting from the use of or
reliance on the provided material.
|Place in your vimfiles/plugin directory (and source
it or restart VIM).
Click on the package to download.
ip used for rating: 184.108.40.206
||Minor tweak: set iskeyword to a-z,A-Z to better highlight misspelled words (restore iskeyword to original value after redraw'ing has highlighted misspelled words)
||New feature: given a range of lines, figure out possible spellings for each misspelled word therein and set-up quickfix to navigate to each misspelled word (with spelling suggestions as the quickfix 'error' message)
Previous features: Thesaurus, anagram, wild-card based spelling