From: Yakov Lerner, Jul 13, 2006 5:26 AM
>
> I realize that installing scripts from remote URLs
> always have security considerations associated with it.
>
> Still, my question is: Let's say that somebody I trust
> published useful script (plugin) at some URL, like http://xyz.
>
> Is there any command or script, supposedly bundled with vim (?)
> that would *in one invocation* download script S from this URL
> right into my ~/.vim/plugin ? Ideally:
> :InstallScript URL
>
> If not, then what's the closest existing thing to such
> :InstallScript functionality ?

Not only is this possible, it is how Vim7 adds additional spellcheck
dictionaries if you do :set spelllang=en,[new lang].

Check this out:

  function! Color_NavajoNight()
  " Change the current color scheme to Zenburn.
      enew
      execute 'Nread http://cream.cvs.sourceforge.net/' .
                        \ '*checkout*/cream/cream/cream-colors-zenburn.vim'
      execute "saveas " . tempname()
      source %
  endfunction
   map <silent> <F12>      :call Color_NavajoNight()<CR>
  imap <silent> <F12> <C-o>:call Color_NavajoNight()<CR>
  vmap <silent> <F12> :<C-u>call Color_NavajoNight()<CR>

Pressing <F12> will automatically change your color scheme to the
Zenburn color scheme stored in the Cream CVS repository.

Really, the only two tricks are using Netrw to read the file, and then
saving it with a name so that you can source it.


-- 
Steve Hall  [ digitect dancingpaper com ]
:: Cream... something good to put in your Vim!
::   http://cream.sourceforge.net


Reply via email to