" file word_complete.vim " author: Benji Fisher " version: 0.3 " Last modified: Wed Jan 12, 2000 10:14:52 Eastern Standard Time if has("menu") amenu &Tools.&Word\ Completion :call DoWordComplete() amenu &Tools.&Stop\ Completion :call EndWordComplete() endif fun! WordComplete() " normal viwy`> " let length=strlen(@") let length=strlen(expand("")) execute "normal a\\" " normal viwy`> " if strlen(@")>length if strlen(expand(""))>length execute "normal viwo" . length . "l\" else if version>505 if strlen(getline("."))>col(".") normal l startinsert else startinsert! endif else execute "normal a*\gh" endif "version>505 endif endfun fun! DoWordComplete() vnoremap `>a vnoremap d if has("mac") vnoremap  a else vnoremap a endif "has("mac") if version>505 vnoremap a vnoremap a vnoremap a endif "version>505 inoremap a a:call WordComplete() inoremap b b:call WordComplete() inoremap c c:call WordComplete() inoremap d d:call WordComplete() inoremap e e:call WordComplete() inoremap f f:call WordComplete() inoremap g g:call WordComplete() inoremap h h:call WordComplete() inoremap i i:call WordComplete() inoremap j j:call WordComplete() inoremap k k:call WordComplete() inoremap l l:call WordComplete() inoremap m m:call WordComplete() inoremap n n:call WordComplete() inoremap o o:call WordComplete() inoremap p p:call WordComplete() inoremap q q:call WordComplete() inoremap r r:call WordComplete() inoremap s s:call WordComplete() inoremap t t:call WordComplete() inoremap u u:call WordComplete() inoremap v v:call WordComplete() inoremap w w:call WordComplete() inoremap x x:call WordComplete() inoremap y y:call WordComplete() inoremap z z:call WordComplete() endfun fun! EndWordComplete() vunmap vunmap if has("mac") vunmap  else vunmap endif "has("mac") if version>505 vunmap vunmap vunmap endif "version>505 iunmap a iunmap b iunmap c iunmap d iunmap e iunmap f iunmap g iunmap h iunmap i iunmap j iunmap k iunmap l iunmap m iunmap n iunmap o iunmap p iunmap q iunmap r iunmap s iunmap t iunmap u iunmap v iunmap w iunmap x iunmap y iunmap z endfun