Re: [Vim-latex-cvs] vimfiles/ftplugin/latex-suite/packages ngerman,NONE,1.1
Brought to you by:
srinathava,
tmaas
From: Mikolaj M. <mi...@wp...> - 2003-01-16 17:24:55
|
On Wed, Jan 15, 2003 at 06:39:00PM -0800, Srinath Avadhanula wrote: > On Wed, 15 Jan 2003, Benji Fisher wrote: > > :execute "source" expand("%:p:h") . "/german" > > > Agreed. Although it should be: > execute 'source '.expand('<sfile>:p:h').'/german' > (<sfile> instead of %) > > \usepackage[german]{babel} > > > > instead of > > > > \usepackage{german} > > > As of now, there isn't. During the scan for \usepcackage's, the > g:Tex_pack_supported is created which lists the packages detected... > Unless a variable like g:Tex_{pack}_options or something similar is > created, this is not possible. This is actually not too hard to > implement, but even if it is implemented, I dont know how to make > the tex quotes function use this information. We will have to revert to > the strategy of modifying that function itself... (But I dont like that > strategy too much because its not really scalable). > Any ideas? Here simple solution package file 'babel': ------- function! Lookfor() let g:pos = line('.').' | normal! '.virtcol('.').'|' let g:line = search('\\usepackage.*{babel}', 'w') if getline(g:line) =~ 'german' source $VIMLATEXMAINPATH/packages/german endif exe g:pos endfunction call Lookfor() " vim:ft=vim:ff=unix: --------- Works for me. Aha, small cheat: $VIMLATEXMAINPATH is defined in main.vim. IMO this is not bad idea - calculating path in each file which needs this information in not very clear. But this in not necessarily good solution. This sources whole package file with its menus and specific commands which is not always cause with babel package. IIRC this turns on only hyphenation, gives access to special letters, and redefines \chapter and similar commands. For (n)german it works. I have wonderful polski package which does many, many more. Maybe Luc can say more? m. ps. To Srinath: g: variables are only for debugging purposes ;) |