Re: [Vim-latex-devel] label viewing
Brought to you by:
srinathava,
tmaas
From: Mikolaj M. <mi...@wp...> - 2003-01-16 17:24:54
|
On Wed, Jan 15, 2003 at 04:00:31PM -0800, Srinath Avadhanula wrote: > Hey Mikolaj, > I was actually thinking of a different way of implementing this... (I > haven't even started)... Here's my take: > call IMAP('\ref{', "\<C-o>:Tex_ListLabels()\<CR>", 'tex') > And Tex_ListLabels() should actually do something like: > function! Tex_ListLabels() > " We want to search labels across files... not just the current > " file... We might cache this in some manner so we don't end up > " spawning shell commands every time the user does \label... > silent! grep \\label{ *.tex > " Open up a window showing the matches... This lets us use vim's own > " excellent quickfix capabilities. > cclose > cwindow 5 > " At this point we might even do something similar to what is done > " in RunLatex()... Open up the file corresponding to this match in a > " preview window... > wincmd p > endfunction > And if possible, we should make this function behave like RunLatex() so > that it also opens up the corresponding file in preview mode when we are > on a line in the cwindow... (So that we have some context aroudnd the > \label) Hope you are getting what I mean... Try making some $\mistake$ > in a tex file and compiling it... I was thinking that the label/citation > browser would behave similarly... > What do you think? Great :) The idea to use quickfix is wonderful but I have to read something about it. Also I don't like to use IMAP here. quickfix and preview are some kind "agressive". Making it appears automagically... I wouldn't like this behaviour. Also mapping this to some key (let's say <F9>) make it easier to react on prefix (write \ref{fig and you will see only \labels for figures). This key will be "lost" but it is possible to make it context sensitive - another function will be called after \cite, another after \ref and maybe others. m. |