tags:

views:

804

answers:

3

I currently use vim in a telnet window for editing code (very old school!). There is a lot of source code (mainly C), so I use tags, cscope etc. to get around. This is ok as far as it goes, but network latency can make every keystroke "laggy", which is not so good!

I'd like to use gvim on my Windows PC (or any editor that can be set up to do this) to:

  1. Edit files remotely via FTP (gvim already can do this)
  2. Use a TAGS file that is either stored locally or on the server (probably more efficient to use one on the server, then I don't have to FTP every file down). I suppose generating the file then FTPing to the proper location on my local machine would be ok.
  3. Run shell commands as if I were in the directory of the file on the server (make, various scripts etc.). I do have ssh access to the machine so I can't think that this would be a problem.

I'm a little familiar with vimscript, so I don't mind doing a little glueing. I thought that I can't be the only person who has ever wanted to do this - hence asking here.

Like I said - if there is any decent editor that has this "built-in", then I don't mind switching!

+1  A: 

'tags' option tells Vim where to look for TAGS file, though I'm not sure whether Vim allows ftp:// or scp:// paths in this option.

You can run commands on server using :!ssh ...

But don't you think it would be better to use one of the source control systems, work with files locally and then put updated files on server?

Paul
+4  A: 

You can also use SSH to edit your file remotely with vim.

:e scp://remote.host.com/project/file

And then use SSH to call make remotely:

:!ssh remote.host.com '(cd project; make)'

ctags

In order to use ctags remotely, I would create the tags file remotely and copy it to the local machine and add scp://remote.host.com/project/ to each file name in the tags files. You can do this with something like

:%s#^\(\w\+\)\t#\1\tscp://remote.host.com/project/#

on the tags file. Then when working on a remote file you use ':set tags=local_ctags/tags' to reference the local (modified) version of the tags file.

f3lix
+1  A: 

How about mounting remote directory localy? You can export it as an SMB share, NFS mount, or there are several equivalents of SSH filesystem (sshfs) available for Windows.

kyku
That's a pretty good idea - the only downside is that I want to run programs on the server not my local machine, so some sort of ssh hacking will probably be necessary.
Greg Reynolds
Ehmm.. Other solutions proposed here also have this problem.
kyku