[Vim-latex-cvs] vimfiles/ftplugin/tex texviewer.vim,1.1,1.2
Brought to you by:
srinathava,
tmaas
From: <mi...@us...> - 2003-04-03 11:53:59
|
Update of /cvsroot/vim-latex/vimfiles/ftplugin/tex In directory sc8-pr-cvs1:/tmp/cvs-serv29681 Modified Files: texviewer.vim Log Message: label line in preview window in the middle higher preview window (height defined in texrc) support for .bbl files support for \thebibliography environment use grep! instead grep (no need for 'bot 1 split') Index: texviewer.vim =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/tex/texviewer.vim,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** texviewer.vim 1 Apr 2003 16:47:51 -0000 1.1 --- texviewer.vim 3 Apr 2003 11:53:54 -0000 1.2 *************** *** 12,16 **** endif ! inoremap <silent> <Plug>Tex_Viewer <Esc>:call <SID>Tex_viewer("default","text")<CR> if !hasmapto('<Plug>Tex_Viewer', 'i') --- 12,16 ---- endif ! inoremap <silent> <Plug>Tex_Viewer <Esc>:call Tex_viewer("default","text")<CR> if !hasmapto('<Plug>Tex_Viewer', 'i') *************** *** 23,35 **** function! s:Tex_lookall(what) ! call <SID>Tex_viewer(a:what, "all") endfunction function! s:Tex_lookbib(what) ! call <SID>Tex_viewer(a:what, "bib") endfunction function! s:Tex_look(what) ! call <SID>Tex_viewer(a:what, "tex") endfunction --- 23,35 ---- function! s:Tex_lookall(what) ! call Tex_viewer(a:what, "all") endfunction function! s:Tex_lookbib(what) ! call Tex_viewer(a:what, "bib") endfunction function! s:Tex_look(what) ! call Tex_viewer(a:what, "tex") endfunction *************** *** 43,47 **** " Description: " ! function! s:Tex_viewer(what, where) " Get info about current window and position of cursor in file --- 43,47 ---- " Description: " ! function! Tex_viewer(what, where) " Get info about current window and position of cursor in file *************** *** 56,74 **** let s:type = matchstr(s:curline, '\\\zs.\{-}\ze{.\{-}$') - " It is necessary to open window and there process grep because Vim - " automatically jumps to first error in clist. - bot 1 split - if exists("s:type") && s:type =~ 'ref' ! exe 'silent! grep "\\label{'.s:prefix.'" '.s:search_directory.'*.tex' call <SID>Tex_c_window_setup() elseif exists("s:type") && s:type =~ 'cite' ! exe 'silent! grep "@.*{'.s:prefix.'" '.s:search_directory.'*.bib' call <SID>Tex_c_window_setup() else let s:word = matchstr(s:curline, '\zs\k\{-}$') ! exe 'silent! grep "\<' . s:word . '" '.s:search_directory.'*.tex' call <SID>Tex_c_window_setup() --- 56,72 ---- let s:type = matchstr(s:curline, '\\\zs.\{-}\ze{.\{-}$') if exists("s:type") && s:type =~ 'ref' ! exe 'silent! grep! "\\label{'.s:prefix.'" '.s:search_directory.'*.tex' call <SID>Tex_c_window_setup() elseif exists("s:type") && s:type =~ 'cite' ! exe 'silent! grep! "@.*{'.s:prefix.'" '.s:search_directory.'*.bib' ! exe 'silent! grepadd! "bibitem{'.s:prefix.'" '.s:search_directory.'*.bbl' ! exe 'silent! grepadd! "bibitem{'.s:prefix.'" %' call <SID>Tex_c_window_setup() else let s:word = matchstr(s:curline, '\zs\k\{-}$') ! exe 'silent! grep! "\<' . s:word . '" '.s:search_directory.'*.tex' call <SID>Tex_c_window_setup() *************** *** 77,94 **** elseif a:where == 'tex' " Process :TLook command ! bot 1 split ! exe 'silent! grep "'. a:what .'" '.s:search_directory.'*.tex' call <SID>Tex_c_window_setup() elseif a:where == 'bib' " Process :TLookBib command ! bot 1 split ! exe 'silent! grep "'. a:what .'" '.s:search_directory.'*.bib' call <SID>Tex_c_window_setup() elseif a:where == "all" " Process :TLookAll command ! bot 1 split ! exe 'silent! grep "'. a:what .'" '.s:search_directory.'*' call <SID>Tex_c_window_setup() --- 75,90 ---- elseif a:where == 'tex' " Process :TLook command ! exe 'silent! grep! "'.a:what.'" '.s:search_directory.'*.tex' call <SID>Tex_c_window_setup() elseif a:where == 'bib' " Process :TLookBib command ! exe 'silent! grep! "'.a:what.'" '.s:search_directory.'*.bib' ! exe 'silent! grepadd! "'.a:what.'" '.s:search_directory.'*.bbl' call <SID>Tex_c_window_setup() elseif a:where == "all" " Process :TLookAll command ! exe 'silent! grep! "'.a:what.'" '.s:search_directory.'*' call <SID>Tex_c_window_setup() *************** *** 101,106 **** function! s:Tex_c_window_setup() - wincmd q - cclose copen 5 --- 97,100 ---- *************** *** 154,158 **** " Handle situation if there is no item beginning with s:prefix. ! " Unfortunately, because we know it late we have to close everthing and " return as in complete process if v:errmsg =~ 'E32\>' --- 148,152 ---- " Handle situation if there is no item beginning with s:prefix. ! " Unfortunately, because we know it late we have to close everything and " return as in complete process if v:errmsg =~ 'E32\>' *************** *** 177,184 **** " Settings of preview window ! 5 wincmd _ setlocal foldlevel=10 ! setlocal scrolloff=0 ! normal! zt " Return to cwindow --- 171,186 ---- " Settings of preview window ! exe g:Tex_PreviewHeight.' wincmd _' setlocal foldlevel=10 ! ! if s:type =~ 'cite' ! " In cite context place bibkey at the top of preview window. ! setlocal scrolloff=0 ! normal! zt ! else ! " In other contexts in the middle. Highlight this line? ! setlocal scrolloff=100 ! normal! z. ! endif " Return to cwindow *************** *** 191,196 **** function! s:CompleteName() ! if s:curline =~ 'cite' ! let bibkey = matchstr(getline('.'), '{\zs.\{-}\ze,') exe s:winnum.' wincmd w' pclose! --- 193,202 ---- function! s:CompleteName() ! if s:type =~ 'cite' ! if getline('.') =~ '\\bibitem{' ! let bibkey = matchstr(getline('.'), '\\bibitem{\zs.\{-}\ze}') ! else ! let bibkey = matchstr(getline('.'), '{\zs.\{-}\ze,') ! endif exe s:winnum.' wincmd w' pclose! *************** *** 200,204 **** exe 'normal! a'.bibkey2."}\<Esc>" ! elseif s:curline =~ 'ref' let s:label = matchstr(getline('.'), '\\label{\zs.\{-}\ze}') exe s:winnum.' wincmd w' --- 206,210 ---- exe 'normal! a'.bibkey2."}\<Esc>" ! elseif s:type =~ 'ref' let s:label = matchstr(getline('.'), '\\label{\zs.\{-}\ze}') exe s:winnum.' wincmd w' |