I want to create a command that will download a large file and save it to my local system. I am not interested in editing this file. I also would like to avoid a huge if block to see what downloaders are available. This is specific to the thesaurus which is why the auto spell download is not going to work.
I have thought the best thing to do would reuse the netrw logic since it was a trusted source for what system programs were available.
So I've tried this:
command! ThesaurusInstall call netrw#Obtain(0, "http://www.gutenberg.org/files/3202/files/mthesaur.txt", "$HOME/.vim/")
Which crashes because I'm not using the function right. I just want a Vim command I can put in my .vimrc which will download that thesaurus file to my .vim/ directory. How can I do this without making my own complicated conditions like
if `curl` … else if `wget` … else if …
if execute('curl')andif execute('wget')are I not re-inventing the same thing the netrw plugin is doing. Why can I not use the netrw plugin functions to do this without having to build my own conditional statement? Does the netrw plugin not already have better fallback defaults? The aversion to reuse bundled code confuses me. – Sukima Nov 08 '16 at 03:57