Hi all (Hugo, sorry about the double-post - I replied *wrong*)

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, Hugo Ahlenius <[EMAIL PROTECTED]> wrote:
| I change my .vimrc very often, and I use vim
| in many computers. The result is that my changes
| are not always updated to all computers.

Mauricio,
Maybe you should consider having your .vimrc (and other vim configuration
files, like plugins etc) under source control? I have all my personal
vimfiles directory + .vimrc under subversion, and it works very well. I
don't synchronize these daily with the repository, unless there are some
major changes, but now and then (weekly?).

Cheers,
Hugo


--
Hugo Ahlenius
fraxinus (at) oxel.net
http://www.oxel.net



Attachment: remotexecute.vim
Description: Binary data

Reply via email to