Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Whenever I want to install a new Vim script on the Linux server I'm working on, my typical workflow is as the following:

  1. surf the plugin's homepage in Vim online using FireXXXX
  2. download a right version of the plugin to my laptop by click some highlighted link
  3. upload the downloaded plugin from my laptop to Linux server using WinSCP

which is really inconvenient. I don't know what is the magic behind this: I mean for the same hyperlink I click it in web browser. I can let you download it but use Wget plus the hyperlink in Linux command-line will end up with nothing but an error indication. Hyperlink in the web browser. Otherwise I can get the link in web browser and then use Wget or some similar tool to actually do the downloding.

I try new cool Vim scripts quite ofte , so you can imagine my dismay when I have to repeat the tedious action all the time. What are some tips which can let me download the Vim scripts in a more "professional" way?


Post edit:

My problem is not find a tool like Wget or cURL. The problem I met is quite specific; to use these tools to download a Vim script. Let's take http://www.vim.org/scripts/script.php?script_id=30 as an example.

It's the normal place where one can get the script, at least for me. But I can't find an working URL from this page that can feed to Wget.

share|improve this question
    
It would help if you gave an example URL and indicated exactly what problems you are having with wget. It (or something like it, e.g. cURL, etc.) is the usual solution to “command line downloading”. –  Chris Johnsen Mar 11 '10 at 3:49
    
are there permissions issues with the linux server? what is the error you are getting? –  kajaco Mar 11 '10 at 6:20
    
@Chris Johensn and kajaco: vim.org/scripts/script.php?script_id=30 I can't find the url for the script in the above link that is my problem. –  HaiYuan Zhang Mar 11 '10 at 8:26
    
The URL for that script seems fairly obvious to me. It is the first link in the table at the bottom of the page. That is what you click to download via a web browser, is it not? Again, what problem are you having with wget? The URL http://www.vim.org/scripts/download_script.php?src_id=9196 (for the 1.13 version on the page you gave) works fine for me with wget 1.12 and curl 7.20.0. –  Chris Johnsen Mar 11 '10 at 18:41
add comment

8 Answers

Take a look at wget http://www.gnu.org/software/wget/

share|improve this answer
add comment

Answering to the specific case of python_fn.vim. The links provided on the page work just fine in wget - they just get the wrong name (download_script.php?src_id=9196). If this is causing you troubles, you can use wget's -O. As in:

wget -O python_fn.vim http://www.vim.org/scripts/download_script.php?src_id=9196

share|improve this answer
3  
The --content-disposition option of wget will cause the downloaded files to use the server-provided name like web browsers do. Also, you may want to quote the URL (I prefer single quotes) so that the shell does not try to expand it as a glob (since it has ? in it; depending on the shell and the options that are active, globs that do not match anything sometimes expand to an empty string, and sometimes cause errors). –  Chris Johnsen Mar 12 '10 at 3:44
    
That's very useful, I actually skimmed the man page to find out if there was such a feature, but apparently not thoroughly enough. –  Sarah Mar 14 '10 at 11:17
add comment

Perhaps GetLatestVimScripts is something for you?

share|improve this answer
add comment

From page 'http://www.vim.org/scripts/script.php?script_id=30' , you can find the download url is 'http://www.vim.org/scripts/download_script.php?src_id=9196'. This step is quite easy.

I think the really problem for you is after

wget http://www.vim.org/scripts/download_script.php?src_id=9196

you got file 'download_script.php?src_id=9196' and you thought the download failed..

Actually the plugins has downloaded successfully as 'download_script.php?src_id=9196', just rename it as 'python_fn.vim' or add '-O python_fn.vim' for wget.

share|improve this answer
add comment

Comparison of open source download tools (most of them command line, including wget tronpxs already mentioened)

share|improve this answer
add comment

To download the file you've mentioned in post edit:

%> wget http://www.vim.org/scripts/download_script.php?src_id=9196
%> mv download_script.php?src_id=9196 python_fn.vim

The general algorithm is:

  1. go to desired vim script page
  2. locate a table with downloads in the bottom which looks like

package | script version | date | Vim version | user | release notes

  1. copy hyperlink of the desired file and feed it to wget
  2. rename resulting file to what you have seen in package column on download page
share|improve this answer
add comment
/usr/bin/vim-addons 

in Ubuntu, but I actually use pathogen and github or

.../download_script.php?src_i=... 

with vimballs and then gunzip and mkdir, and :UseVimball

share|improve this answer
add comment

Use a text-based browser, like w3m.

w3m http://www.vim.org/scripts/script.php?script_id=30 

It won't have any problems with redirection, so pointing it to the script download url:

w3m http://www.vim.org/scripts/download_script.php?src_id=9196

Will present you with the option of downloading the file.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.