Como eu disse em um comentário, o plugin netrw, que lida com http://
, não lida com https://
(isso de olhar para o código do plugin). Eu entrei no código e recebi https://
working (não há garantias de que ele esteja livre de bugs, mas funcionou para os sites que eu tentei). Eu criei um par de patches, para netrw.vim
e netrwPlugin.vim
. Veja como aplicá-los, mantendo os originais inalterados e as versões corrigidas em sua configuração local:
- Verifique se você tem um diretório
~/.vim/autoload
e ~/.vim/plugin
.
- Faça o download dos patches, lembre-se de onde você os salvou (suponho que seja em
~/.vim/patches/netrw.patch
e ~/.vim/patches/netrwPlugin.patch
)
cp /usr/share/vim/vimcurrent/autoload/netrw.vim ~/.vim/autoload
cp /usr/share/vim/vimcurrent/plugin/netrwPlugin.vim ~/.vim/plugin
patch ~/.vim/autoload/netrw.vim ~/.vim/patches/netrw.patch
patch ~/.vim/plugin/netrwPlugin.vim ~/.vim/patches/netrwPlugin.patch
Isso funciona no meu vim, 7.3, espero que você também. Se não, use as mudanças como um guia e veja se você pode cortá-lo.
Caso os pastebins desapareçam, aqui estão eles:
netrwPlugin.patch
56c56
< au BufReadCmd ftp://*,rcp://*,scp://*,http://*,dav://*,davs://*,rsync://*,sftp://* exe "silent doau BufReadPre ".fnameescape(expand("<amatch>"))|call netrw#Nread(2,expand("<amatch>"))|exe "silent doau BufReadPost ".fnameescape(expand("<amatch>"))
---
> au BufReadCmd ftp://*,rcp://*,scp://*,http://*,https://*,dav://*,davs://*,rsync://*,sftp://* exe "silent doau BufReadPre ".fnameescape(expand("<amatch>"))|call netrw#Nread(2,expand("<amatch>"))|exe "silent doau BufReadPost ".fnameescape(expand("<amatch>"))
netrw.patch
682c682
< if choice =~ "^.*[\/]$" && b:netrw_method != 5 && choice !~ '^http://'
---
> if choice =~ "^.*[\/]$" && b:netrw_method != 5 && choice !~ '^http://' && choice !~ '^https://'
835c835
< elseif b:netrw_method == 5
---
> elseif b:netrw_method == 5 || b:netrw_method == 50
850c850,854
< exe s:netrw_silentxfer."!".g:netrw_http_cmd." ".shellescape("http://".g:netrw_machine.b:netrw_fname,1)." ".g:netrw_http_xcmd." ".shellescape(tmpfile,1)
---
> if b:netrw_method == 5
> exe s:netrw_silentxfer."!".g:netrw_http_cmd." ".shellescape("http://".g:netrw_machine.b:netrw_fname,1)." ".g:netrw_http_xcmd." ".shellescape(tmpfile,1)
> else
> exe s:netrw_silentxfer."!".g:netrw_http_cmd." ".shellescape("https://".g:netrw_machine.b:netrw_fname,1)." ".g:netrw_http_xcmd." ".shellescape(tmpfile,1)
> endif
853c857,861
< exe s:netrw_silentxfer."!".g:netrw_http_cmd." ".shellescape(tmpfile,1)." ".shellescape("http://".g:netrw_machine.b:netrw_fname,1)
---
> if b:netrw_method == 5
> exe s:netrw_silentxfer."!".g:netrw_http_cmd." ".shellescape(tmpfile,1)." ".shellescape("http://".g:netrw_machine.b:netrw_fname,1)
> else
> exe s:netrw_silentxfer."!".g:netrw_http_cmd." ".shellescape(tmpfile,1)." ".shellescape("https://".g:netrw_machine.b:netrw_fname,1)
> endif
865c873,877
< exe s:netrw_silentxfer."!".g:netrw_http_cmd." ".shellescape(tmpfile,1)." ".shellescape("http://".g:netrw_machine.netrw_html,1)
---
> if b:netrw_method == 5
> exe s:netrw_silentxfer."!".g:netrw_http_cmd." ".shellescape(tmpfile,1)." ".shellescape("http://".g:netrw_machine.netrw_html,1)
> else
> exe s:netrw_silentxfer."!".g:netrw_http_cmd." ".shellescape(tmpfile,1)." ".shellescape("https://".g:netrw_machine.netrw_html,1)
> endif
1565a1578
> let httpsurm = '^https://\([^/]\{-}\)\(/.*\)\=$'
1598a1612,1618
> " Method#5.5: https://user@hostname/...path-to-file {{{3
> elseif match(a:choice,httpsurm) == 0
> " call Decho("https://...")
> let b:netrw_method = 50
> let g:netrw_machine= substitute(a:choice,httpsurm,'',"")
> let b:netrw_fname = substitute(a:choice,httpsurm,'',"")
>
7075c7095
< if w:netrw_method == 2 || w:netrw_method == 5
---
> if w:netrw_method == 2 || w:netrw_method == 5 || w:netrw_method == 50