Re: [Vim-latex-devel] Revolution! :)
Brought to you by:
srinathava,
tmaas
From: <mi...@wp...> - 2003-09-26 23:16:17
|
On 25 Sep 2003 at 20:53, Luc Hermitte wrote: > > Jokes aside. There are still issues: > > creating menus is based on list returned by globpath(). How to sort > > endresults and remove duplicate entries? > > The last entry according to 'runtimepath' should be the one! Or the > first, as you wish. I'm not sure sort or uniq will be very useful here. Hmm. I think you are right here. I will do it another way: for package files add common plugin header (if exists() finish etc.) and source them if repeated as regular runtime files are treated. for templates/macros :read in only first entry. Sourcing last has no sense. Files in $HOME obviously should have priority. dictionaries: add all dictionaries with asked name. > > Just in case, with :SearchInRuntime, I would have written something > like: > function s:AddFileToList(file) > let fn = fnamemodify(a:file, ':t') > if s:list =~ a:file > " use the "keep the last entry"-policy > let s:list = substitute(s:list, > \ "^\\(\\|\n\\)\\zs[^\\n]*".fn."\\ze\\(\n\|$\\)", a:file, 'g') > else > let s:list = s:list . "\n".a:file > endif > endfunction > command! -nargs=1 LetFiles :call s:AddFileToList('<q-args>') > > let s:list = '' > SearchInRuntime! :LetFile packages/foo*.vim This function is nice but requires iterating through list of files which is sloooow in VimL. > The best solutions for uniq and sort have been included into > system_utils.vim avaible on my web site. > http://hermitte.free.fr/vim/ressources/vimfiles/plugin/system_utils.vim Thanks. I will look into it. m. |