Forwarding to list.

-------- Original Message --------
Subject: Re: .vimrc from URL
Date: Fri, 5 Jan 2007 13:12:41 +0200
From: Albie Janse van Rensburg <[EMAIL PROTECTED]>
To: A.J.Mechelynck <[EMAIL PROTECTED]>
References: <[EMAIL PROTECTED]> <[EMAIL PROTECTED]> <[EMAIL PROTECTED]> <[EMAIL PROTECTED]> <[EMAIL PROTECTED]>

Hi all

I find this idea of a net-vimrc very interesting, so I have made a
simple .vimrc that the OP can use:

===============================
so $VIMRUNTIME/plugin/netrwPlugin.vim
Nread "{website}_vimrc.http"
sav! ~/__vimrc
so ~/__vimrc
silent !rm ~/__vimrc
enew
===============================

(For some reason, the netrw plugin is named "netrwPlugin.vim" on my
version of vim.  Modify as is needed.)

Of course, this must be loaded in each vimrc on the network, and you
will need a web server to host the master vimrc.

I have also hacked about a bit, and now I also have some functions for
sourcing a file over a network, which I am attaching in
"remotexecute.vim". If someone could look it over it would be
appreciated.  It only handles reading over FTP and HTML at the moment.

I then went ahead and added the following to the tail of my vimrc:

===================================

" netrw source the remote exec functions file - ugly!
    new
    Nread "http://morph.telspace.co.za/remotexecute.vim";
    let s:tempfilename = tempname()
    execute("sav! " . s:tempfilename)
    execute("so " . s:tempfilename)
    execute("silent !rm " . s:tempfilename)
    quit!

" Now that we have the functions for sourcing files over a net connection, we
" can map keys to edit our vimrc over the net, and associated functions.

" Read the _vimrc into a new buffer
nmap <silent> <C-F1> :new<CR>:execute ReadNetFileFTP("xxxx", "_vimrc",
"xxxx")<CR>
" Write the current buffer to the onlince _vimrc
nmap <silent> <S-F1> :execute WriteNetFileFTP("xxxx", "_vimrc", "xxxx")<CR>

===================================

Unfortunately, there seems to be something wrong with the write (Nwrite)
action, whenever I try to write a file back to the server, I get the error:

===================================
(netrw) Processing your write request
***netrw*** VIR14E.tmp: File not found
Press <cr> to continue
===================================

or (with g:netrw_ftp = 1):

===================================
(netrw) Processing your write request
***netrw*** Invalid command.
Press <cr> to continue
===================================

How can I use netrw to write a file over ftp?  I have tried various
different methods to do this, but none seem to work.  Does anyone else
have the same problem?

--
Albie Janse van Rensburg (neonpill)

Registered Linux User 438873 | <http://counter.li.org>

On 1/5/07, A.J.Mechelynck <[EMAIL PROTECTED]> wrote:
Mikolaj Machowski wrote:
> On pią sty 5 2007, Mikolaj Machowski wrote:
>> Mikolaj Machowski wrote:
>>> On pią sty 5 2007, Maurí­cio wrote:
>>>> Or else, have the following at the top of the vimrc:
>>>>
>>>>    let g:vimrcdate =               "4 Jan 2007 22:49 UTC"
>>>>    echo This vimrc was last changed on" g:vimrcdate
>>>>    if input("Do you want to continue? ") !~? "y"
>>>>            qall!
>>>>    endif
>>> Since this requires specific .vimrc OP can explicitly source netrw
>                                                ^^^^^^^^^^^^^^^^^^^^^^^
>>> at the beginning of .vimrc; open net address; write it to temporary
>>> file; source that file; remove temporary file.
>>>
>>> m.
>> I repeat: when the vimrc is sourced, the plugins (such as netrw) are NOT
>> YET sourced. So if the vimrc tries to issue
>
> That is why I wrote "explicitly source netrw".
>
> m.
>
>

Oops, I read too fast. Looks like a kludge to me but I guess it would work.


Best regards,
Tony.

Attachment: remotexecute.vim
Description: Binary data

Reply via email to