Re: [Vim-latex-devel] Revolution! :)
Brought to you by:
srinathava,
tmaas
From: Luc H. <her...@fr...> - 2003-09-25 18:51:25
|
Hello, * On Thu, Sep 25, 2003 at 08:15:50PM +0200, mi...@wp... <mi...@wp...> wrote: > First is only diff (diff -u -3 -p), second is complete file > packages.vim. Revolution is: now functions in packages.vim looks in > all rtp directories for package files and creates complete list. > Sounds unimpressive but it allow for creating real distribution > packages and real *nix behaviour with system wide files and local > modifications. I am dusting off 'man rpm' ;) Sounds important : one of the first things I added into mu-template -- thanks to searchInRuntime.vim (which defines some hybrid commands between :runtime and the unix's `find' tool) > 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. 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 > I remember long discussions on vim-list about Sort and Uniq. I didn't > follow it closely. Could someone suggest the best solutions? 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 Regars, -- Luc Hermitte http://hermitte.free.fr/vim/ |