English 中文(简体)
ed remote
原标题:edit a remote file with vim
  • 时间:2012-05-18 03:29:10
  •  标签:
  • linux
  • vim
  • scp

I m trying to edit a remote file with vim 7.2 using this command ":e scp://username@host//home/oracle/filename.ksh". But I get this error "scp: not found". Then I placed the scp file in home/oracle. But still I get the same error. What am I missing?

最佳回答

自Vim 6.x 以来,netrw plugin作为标准原始材料安装。 因此,你可以通过偷窃、rc、剪辑或http://www.un.org/ga/president

关于<代码>scp的行动,如:

vim scp://[email protected]//path/to/document

http://vim.wikia.com/wiki/Editing_remote_files_via_scp_in_vim” 单页。

问题回答

根据贵处的软件配置,你可以轮流使用引信和鞋子,以实现这一目标。


在大多数分配中,这为用户(取决于用户许可政策)能够实际在当地档案系统中某个地方搭建一个短处。

指挥所看着这样的情况(假定你已经安装了sh):

sshfs <user>@<host>:<remote_location> <local_path>

例如:

sshfs [email protected]:/var/www /mnt/sshfsmounts/www

这样做,你可以安全地将遥远的档案作为你们的地方档案系统的一部分,使用这些档案。

vim /mnt/sshfsmounts/www/index.php

例如。


这方面的一些有益的联系:

http://en.wikipedia.org/wiki/SSHFS"rel=“nofollow” http://en.wikipedia.org/wiki/SSHFS

http://fuse.sourceforge.net/sshfs.html“rel=“nofollow” http://fuse.sourceforge.net/sshfs.html。

[3] -


Be aware of the fact that permissions you will have on mounted ssh filesystem are those applied for the user specified inthe sshfs command, completed by permissions you have on the local file system for the mount point. This means you basically need to have write access on both the mount point and on the ssh host under specified sshfs user.

您应贴上<条码>>>> 东道/代码>,然后使用该文本的正文复制件,以便编辑文档:

ssh username@host
vim /home/oracle/filename.ksh

Otherwise, if you must, scp the file locally (outside of vim), edit it, then scp the file back to host:

scp username@host:/home/oracle/filename.ksh .
vim filename.ksh
scp filename.ksh username@host:/home/oracle/




相关问题
Autoupdate VIM Plugins?

Is it possible to update vim plugins automatically?

how to unindent in vim without leaving edit mode?

I m writing a lot of python code recently, and i used the tab-to-space mode in vim. I was just wondering how would i unindent in vim without leaving edit mode for example after i finished if...: block....

Scrolling inside Vim in Mac s Terminal

I ve been googling around trying to figure out if it s possible to use my mouse wheel to scroll while inside Vim in Mac s Terminal, with no luck. It seems as if only X11 or iTerm support this. Before ...

Vim - Deleting XML Comments

How do I delete comments in XML? If the opening and the closing comment tags are on the same line, I use :g/^<!--.*-->$/d to delete the comment. How to delete the comments that are spread ...

Limiting a match in vim to certain filetypes?

I have the following in my .vimrc to highlight lines longer than 80 chars: highlight OverLength ctermbg=red ctermfg=white guibg=#592929 match OverLength /\%81v.*/ This works quite well. However, the ...

Profiling Vim startup time

I’ve got a lot of plugins enabled when using Vim – I have collected plugins over the years. I’m a bit fed up with how long Vim takes to start now, so I’d like to profile its startup and see which of ...

热门标签