Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VIM support to upload via SFTP

Tags:

vim

plugins

sftp

I am used to Sublime's plugin that let's you do a mapping between your local project and a remote project. By doing so, when you are done editing a file, you can do a right click and "Upload file" action which automatically updates the file in the remote server.

I am wondering what would be the best way to do this while programming with VIM. I am looking for an easy way to be able to map a local project to a remote one and be able to upload the file easily.

Thanks

like image 967
Hommer Smith Avatar asked Nov 19 '12 09:11

Hommer Smith


1 Answers

If all you want is to edit files on a remote server, try vim's netrw feature:

vim scp://you@yourserver//path/to/directory/

Edit a file directly:

vim scp://you@yourserver//path/to/directory/somefile.txt

Or if you are already in vim, hit ESC, then type:

:e scp://you@yourserver//path/to/directory/

This assumes that:

  1. you have ssh installed (usually the case for Linux or OSX; if you are on Windows then it depends).
  2. you have ssh access to the server via some convenient method (sshagent and keys)
like image 115
Faiz Avatar answered Nov 11 '22 15:11

Faiz