LaT*_*ipe 26 ftp vim configuration
我在Ubuntu 9.10上使用GVIM.我正在寻找配置GVIM的正确方法,以便能够通过例如ftp来编辑远程文件(HTML,PHP,CSS).
error detected while processing BufEnter Auto commands for "*":E472: Command failed.
那么如何使用GVIM编辑我本地主机上的远程文件呢?
oiv*_*vio 45
我发现通过ssh(通过sshfs)运行文件系统比让编辑器处理这些东西或在ssh隧道上运行编辑器本身更好.
所以你需要
apt-get install sshfs
Run Code Online (Sandbox Code Playgroud)
然后
sshfs remoteuser@remotehost:/remote/path /local/mountpoint
Run Code Online (Sandbox Code Playgroud)
这将让您编辑远程文件,就像它们在本地文件系统上一样.
为了使它更平滑,您可以在/ etc/fstab中添加一行
sshfs#remoteusername@remotehost:/remote/path /local/mountpoint fuse user,noauto
Run Code Online (Sandbox Code Playgroud)
出于某种原因,我发现我必须使用fusermount -u /local/mountpoint
而不是umount /local/mountpoint
在试验时.也许这只是我的发行版.
最近我还注意到安装用户必须在fuse
组中.所以:
sudo addgroup <username> fuse
Run Code Online (Sandbox Code Playgroud)
当然,另一个流行的选择是在一台机器上的GNU Screen会话中运行vim(而不是gvim),并通过ssh从任何地方连接到该会话.整天在工作和晚上编码你的办公室电脑,重新连接到你的gnu屏幕会话,并准确地选择你离开的地方.我使用发现更丰富的调色板是gvim在使用vim时唯一真正错过的东西,但实际上可以通过urxvt的分叉来修复,它可以让你自定义整个256位色调,而不仅仅是16位色调调色板的位置,大多数终端仿真器将让您自定义.
小智 8
有一种方法是使用远程主机的副本,使用SSH将X11客户端转发给您,如下所示:
user@local:~/$ ssh -X user@host
...
user@host:~/$ gvim file
Run Code Online (Sandbox Code Playgroud)
后一个命令应该在桌面上打开gvim.当然,这依赖于首先安装了X11/gnome/gvim的远程主机,这可能不是您正在寻找的解决方案/在您的情况下的选项.
注意:X11转发可能存在安全风险.
小智 5
试试这个
:e scp://username@remotehost//path/to/file
Run Code Online (Sandbox Code Playgroud)
请注意,在remotehost之后使用//是故意的,它给出了文件的绝对路径:)
http://www.celsius1414.com/2009/08/19/how-to-edit-remote-files-with-local-vim/