Update of /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite
In directory sc8-pr-cvs1:/tmp/cvs-serv2921
Modified Files:
packages.vim
Log Message:
completion of TPackage command
Index: packages.vim
===================================================================
RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/packages.vim,v
retrieving revision 1.36
retrieving revision 1.37
diff -C2 -d -r1.36 -r1.37
*** packages.vim 18 Jun 2003 01:09:30 -0000 1.36
--- packages.vim 11 Jul 2003 22:47:35 -0000 1.37
***************
*** 18,24 ****
let s:menu_div = 20
! com! -nargs=* TPackage let s:retVal = Tex_pack_one(<f-args>) <bar> normal! i<C-r>=s:retVal<CR>
com! -nargs=0 TPackageUpdate :silent! call Tex_pack_updateall(1)
com! -nargs=0 TPackageUpdateAll :silent! call Tex_pack_updateall(1)
imap <silent> <plug> <Nop>
--- 18,41 ----
let s:menu_div = 20
! com! -complete=custom,Tex_CompletePackageName -nargs=* TPackage let s:retVal = Tex_pack_one(<f-args>) <bar> normal! i<C-r>=s:retVal<CR>
com! -nargs=0 TPackageUpdate :silent! call Tex_pack_updateall(1)
com! -nargs=0 TPackageUpdateAll :silent! call Tex_pack_updateall(1)
+
+ " Tex_CompletePackageName: for completing names in TPackage command {{{
+ " Description: get list of package names with globpath(), remove full path
+ " and return list of names separated with newlines.
+ "
+ function! Tex_CompletePackageName(A,P,L)
+ let list = globpath(s:path.'/packages','*')
+ let list = substitute(list,'\n',',','g')
+ if has("win32") || has("dos32") || has("dos16")
+ let list = substitute(list,'^\|,[^,]*\',',','g')
+ else
+ let list = substitute(list,'^\|,[^,]*/',',','g')
+ endif
+ let list = substitute(list,',','\n','g')
+ return list
+ endfunction
+ " }}}
imap <silent> <plug> <Nop>
|