Can vim open a shared folder in another local machine and edit files? - vim

I googled and found that vim scp://server/path/to/file can edit a single file. But I could not use it to open a folder.

Use vim's network-oriented file transfers.
According to the documentation, it "supports remote and local directory browsing, and supports editing files across the network using a variety of methods".

Just add a / at the end of your url:
vim scp://server/path/to/

Related

Using Vim with syntastic and SCP

I edit some remote files using vim in combination with scp. When editing a remote php file using this method syntastic plugin isn't working.
When I type,
:SyntasticInfo
it says info for file type is php. So it recognizes the file type but isn't doing the check. Is this possible using vim with scp?
This is answered in the manual, see :help syntastic-netrw:
The standard plugin netrw allows Vim to transparently edit files over network and inside archives. Currently syntastic doesn't support this mode of operation. It can only check files that can be accessed directly by local checkers, without any translation or conversion.

How can I use local vim setting on AWS server?

Is there a faster way to edit AWS EC2 config file using my local env vimrc?
I found that it is very hard to edit file in remote server using default vim settings
Any one has good solution to make ourself better?
Remote editing
I suppose you're using ssh to log into your AWS server and launch Vim there. An alternative is to launch Vim on your local system, and open the remote file in there, e.g. via the built-in netrw plugin:
$ vim scp://hostname/path/to/file
or within Vim:
:edit scp://hostname/path/to/file
Sharing Vim configuration across machines
There are many different approaches for sharing your .vimrc and plugins across multiple machines. Possible solutions were recently collected at What is the best way to deal with vim plugins on multiple machines?

VIM support to upload via 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
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:
you have ssh installed (usually the case for Linux or OSX; if you are on Windows then it depends).
you have ssh access to the server via some convenient method (sshagent and keys)
Most serious FTP clients let you edit remote files locally. Filezilla, gFTP, Transmit, Cyberduck, YummyFTP… they all have their own "Edit in…" button. GUI FTP clients may not be sexy hacker tools but they work very well.
Some of those serious FTP clients have synchronisation features or folder watchers. It might be worth your time to look around for such a feature.
Of course, you can also use Vim itself to edit a remote file via FTP or SFTP:
$ vim sftp://user#machine/filename
$ vim ftp://user#machne/filename
and list remote files:
$ vim sftp://user#machine/directory/
See :help netrw for more info.
Did you consider using a VCS like Subversion, Git or Mercurial?

How to access Windows shared folders using emacs

I am using Emacs on Linux and would want to know how to access my Windows shared folders from Emacs.
I am able to perform this operation using nautilus (gnome file manager).
Windows shared folders are usually samba shares which can be accessed using tramp. You can find the relevant part in the tramp documentation here in the "smb -- smbclient" subsection. The correct syntax should be something along the lines of
/smb:USER%DOMAINNAME#HOST:/REMOTEPATH

Vim FTP Plugin for IDE-like behavior

I have gVim (with: NERDTree, minibufexpl). Right now, I can edit files locally with IDE-like feel with NERDTree for a file explorer and minibuf for tabs.
However, I am used to editing files on dummy server I have set up at home. I use Zend Studio to edit files through FTP. Is this feature available in Vim? If so, does it "integrate" well with NERDTree? I would like to browse my FTP directory using NERDTree.
Thank you,
Wenbert
You can edit files remotely over ftp or sftp or scp or whatnot with vim:
vim ftp://user#host/some/file
Of course, this also works with tabs. Don't know about minibuf, though.
Unfortunately, the NERDTree plugin does not seem to support this. However, the :Explore command plays along just nicely.
Of course, you could simply use FTPFS to mount a remote directory and work with that as if it was local storage.

Resources