[Vim-latex-devel] Re: new dir for bibliography?
Brought to you by:
srinathava,
tmaas
From: Luc H. <her...@fr...> - 2003-04-08 11:41:03
|
Hello, * On Tue, Apr 08, 2003 at 10:12:18AM +0200, Mikolaj Machowski <mi...@wp...> wrote: > I have got request to make possible looking for bibliography in other > directory than directory of edited file. > > The best solution is to use grep but it needs such combination: > > elseif exists("s:type") && s:type =~ 'cite' > let grep_prg = &grepprg > set grepprg=grep\ -Hrn\ --include='*.bib'\ $*\ /dev/null > exe 'silent! grep! "@.*{'.s:prefix.'" '.s:search_directory BTW, the use of quotes or double quotes may cause a problem with &shellquote and &shellxquote. Anyway, I have tried to set &grepprg by hand, but still, I'm not able to use /usr/bin/grep (with your parameters) from my win32-vim + cygwin-bash as shell. Actually, I think I have never been able to do so. [ grepprg == grep\ -Hrn\ --include='*.bib'\ $* (± /dev/null) [ :grep '@.*{' /cygdrive/c/localtexmf/bibtex [ -> E303: Can not open the .swp file for [ "/cygdrive/c/localtexmf/bibtex/ASTORIA/astoria.bib", retrieval [ impossible ... or something like that. [ with: [ shellquote = [ shellxquote=" [ shell =c:\cygwin\bin\bash.exe [ shellredir =>%s 2>&1 [ shellpipe = 2>&1| tee [ shellslash = 1 The same command from bash works very well, and don't require I propose /dev/null as the last argument. > [...] > call <SID>Tex_c_window_setup() Where is this function defined ? > With changing value of &grepprg. Alas, I don't know how to make it > cross-platform. grep is easy to configure (GNU grep compatible grep tool > as requirement and variable in texrc) but what about /dev/null? > Without that lS doesn't work on terminal. Maybe something like that > (example line): > > exe "set grepprg=".g:Tex_grepprg."\ -Hrn\ --include='*.bbl'\ $*".s:devnull If the grep program is "findstr", ie the default win32-vim (called from the file-explorer or $COMSPEC), I doubt that -Hrn or --include will be supported. Some of its various useful options are: /n -> print line numbers /S -> recursion /R -> use regular expressions /M -> only the filename of the matching files /D:r,p -> search in a list of directories delimited by semi-comma. [it seems there is a little error in the doc at this point] > And at the beginning: > if has("unix") || has("mac_unix") || has("cygwin") Personnally, I'd rather test &sh =~'sh'. I found it more accurate than has('cygwin'). BTW, I have developped a little plugin aimed at easying the development of portable plugins -- I still have the documentation to finish and some tests to conduct. So far it seems quite functional.[1] > How such combination would work on other than Linux systems? Impossible to make it work on my system (cygwin-bash + win32-vim). :-( I don't know if it is due to an error of configuration on my side or anything else. [1] http://hermitte.free.fr/vim/ressources/system_utils.tar.gz html version of the documentation at: http://hermitte.free.fr/vim/ressources/vimfiles/doc/system_utils.html -- Luc Hermitte http://hermitte.free.fr/vim/ |