[Vim-latex-cvs] vimfiles/ftplugin/latex-suite packages.vim,1.37,1.38
Brought to you by:
srinathava,
tmaas
From: <mi...@us...> - 2003-07-15 21:33:31
|
Update of /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite In directory sc8-pr-cvs1:/tmp/cvs-serv11331 Modified Files: packages.vim Log Message: Make Tcommand completion working on all systems and only in version 6.2 and above Index: packages.vim =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/packages.vim,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** packages.vim 11 Jul 2003 22:47:35 -0000 1.37 --- packages.vim 15 Jul 2003 21:33:23 -0000 1.38 *************** *** 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> --- 18,51 ---- let s:menu_div = 20 com! -nargs=0 TPackageUpdate :silent! call Tex_pack_updateall(1) com! -nargs=0 TPackageUpdateAll :silent! call Tex_pack_updateall(1) ! " Custom command-line completion of Tcommands is very useful but this feature ! " is available only in Vim 6.2 and above. Check number of version and choose ! " proper command and function. ! if v:version >= 602 ! com! -complete=custom,Tex_CompletePackageName -nargs=* TPackage let s:retVal = Tex_pack_one(<f-args>) <bar> normal! i<C-r>=s:retVal<CR> ! ! " 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 packnames = globpath(s:path.'/packages','*') ! let packnames = substitute(packnames,'\n',',','g') ! let packnames = substitute(packnames,'^\|,[^,]*/',',','g') ! let packnames = substitute(packnames,',','\n','g') ! "let pwd = getcwd() ! "exe 'lcd '.s:path.'/packages' ! "let packnames = glob('*') ! "exe 'lcd '. pwd ! return packnames ! endfunction ! " }}} ! ! else ! com! -nargs=* TPackage let s:retVal = Tex_pack_one(<f-args>) <bar> normal! i<C-r>=s:retVal<CR> ! ! endif imap <silent> <plug> <Nop> |