LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   Editing remote files (on FTP) with VIM does not works (http://www.linuxquestions.org/questions/linux-software-2/editing-remote-files-on-ftp-with-vim-does-not-works-478193/)

depi 08-28-2006 04:25 PM

Editing remote files (on FTP) with VIM does not works
 
Hi everyone!

In the past three days I'm fighting with editing files on my web FTP server.

I know that if I want to edit files online I just need to do for example
Code:

:e ftp://username@host/path/to/file
- yes I'm prompted to insert my password but then VIM (or GVim) just freeze-up and I cannot do anything. If I try to insert any command than I get only some strange characters so I must close the window (or terminal)

Or sometimes it connects but open only blank file.

So what can be the problem? The password and username is correct. (I can connect to FTP through gFtp or MC very well)

Also I would like to know how can I browse my files online on FTP.

If it helps I'm using Ubuntu, but I think that is not the point.

ramram29 08-29-2006 10:48 AM

FTP is for file transfers only. Hence, FTP (File Transfer Protocol). You should transfer or copy your file from the remote computer to your local computer first, then you can edit it in your local hard drive. If you want to overwrite the file then you have to upload it but you can only do that if you have the permission to do so.

In contrast, NFS allows you to mount the remote directory and modify the file as if it was on your hard disk.

tbk 09-04-2006 08:18 AM

Quote:

Originally Posted by depi
I know that if I want to edit files online I just need to do for example
Code:

:e ftp://username@host/path/to/file
- yes I'm prompted to insert my password but then VIM (or GVim) just freeze-up and I cannot do anything. If I try to insert any command than I get only some strange characters so I must close the window (or terminal)

Or sometimes it connects but open only blank file.

The syntax is
Code:

:e ftp://username@host//absolute/path/to/file
(note the extra slash) or
Code:

:e ftp://username@host/relative/path/to/file/from/home/directory
This may explain why the file opens up blank (i.e. it's not found) but not the dodgy connections.

tbk 09-04-2006 08:23 AM

Quote:

Originally Posted by ramram29
FTP is for file transfers only. Hence, FTP (File Transfer Protocol). You should transfer or copy your file from the remote computer to your local computer first, then you can edit it in your local hard drive. If you want to overwrite the file then you have to upload it but you can only do that if you have the permission to do so.

In contrast, NFS allows you to mount the remote directory and modify the file as if it was on your hard disk.

True, but vim has the facility to edit remote files by ftp or scp - vim copies the file from the server to a tmp directory and on saving copies the new file back.


All times are GMT -5. The time now is 03:22 PM.