在许多主机上使用 emacs
每天我:
- 使用多个运行 Linux、Windows 或 MacOS X 的工作站
- 在非上述任何工作站的其他 Linux 主机上编辑文件
这里唯一的共同点是互联网连接所有这些主机:工作站和服务器。我也可以在我的工作站上保持所有配置文件同步,并且可以在所有工作站上运行 X 服务器。运行 emacs 的正确方法是什么?我不想牺牲任何功能。
在我的理想世界中,我可以在远程主机上输入“emacs foo.txt”,然后通过 X 转发会发生一些神奇的事情,以在我的工作站的现有 emacs 会话中显示该文件。
非解决方案
- 流浪汉:当我操作远程主机时,编辑器只是我工作流程的一部分。我需要打开一个终端,以便我可以快速运行其他命令。流浪汉在这方面都是错误的。
- ncurses emacs:很糟糕,我想要图形类型的
如果您对我的问题没有肯定的答案,请不要只是猜测。谢谢。
On a daily basis I:
- use multiple workstations running either Linux, Windows, or MacOS X
- edit files on additional Linux hosts that are not any of the workstations mentioned above
The only common element here is that the internet connects all of these hosts: workstations and servers. I can keep all of the config files in sync on my workstations too and can run an X server on all of them. What's the right way of running emacs? I don't want to sacrifice any features.
In my ideal world I can type 'emacs foo.txt' on a remote host and some magic happens via X forwarding to display the file in my workstation's existing emacs session.
Non-solutions
- tramp: when I'm manipulating a remote host an editor is just part of my workflow. I need a terminal open so I can run other commands quickly. tramp is all wrong for this.
- ncurses emacs: sucks, I want the graphical kind
If you don't have a positive answer to my question, please don't just guess. Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
你尝试过使用
eshell
进行tramp吗?您可以“cd /remote.host:/some/path”并从那里编辑文件,如果您输入非内置文件,它会启动一个 ssh 管道来运行它。相当光滑。Have you tried tramp with
eshell
? You can "cd /remote.host:/some/path" and edit files from there, and if you type a non-built-in, it fires up a ssh pipe to run it. Quite slick.我不明白为什么流浪汉不是一个解决方案。您可以使用 trapmp 进行编辑,并使用 xterm+ssh 在终端中执行您需要的任何操作。
I fail to see why tramp is not a solution. You can edit using tramp, and do whatever you need in a terminal using xterm+ssh.
好吧,如果您可以在 Windows 和 OSX 机器上安装 X 客户端,那么您应该能够在任何这些平台上运行 X 版本的 emacs 并将显示设置回您的工作站。这将为您提供漂亮的 WIMP 界面。
然而,有几种解决方案可以使终端对同一个盒子保持打开状态。一种方法是通过 telnet 登录两次。一次用于 emacs 会话,一次用于 shell。
当然,另一个选择是使用
meta-x shell
在 emacs 内打开 shell 缓冲区。真正的 emacs 大师更喜欢在 emacs 中运行他们的操作系统,而不是相反。 :-)Well, if you can setup X clients on your Windows and OSX boxes, you should be able to run an X version of emacs on any of those platforms and set the display back to your workstation. That would give you your nice WIMP interface.
However there are a couple of solutions to keeping a terminal open to the same box. One is to just telnet into it twice. Once for your emacs session, and once for a shell.
The other option of course is to use
meta-x shell
to bring up a shell buffer inside of emacs. A true emacs guru prefers to run their OS inside of emacs, rather than the other way around. :-)我使用的方法基于对 Emacs 脚本和重要公共文件的源代码控制(使用 Git)。这为我提供了一致的代码库,因此我不必记住哪个主机具有哪个脚本或文件(或我正在寻找的版本)。 Git 特别适合支持这种机制,而且我几乎已经养成了每天更新 master origin 存储库的习惯。在脚本(Emacs 和 bash shell 脚本)中,我使用机器定制的代码来处理本地需求。这个系统已经实施一年多了,我发现它非常有效。这是我多年来看到的推荐技术。我发现它在 CVS 和 Subversion 中显得笨拙,但 git 感觉是为这项工作量身定制的。也就是说,我喜欢您选择作为免费工具的解决方案,并期待将其添加到组合中。
The approach I use is based on source controlling the Emacs scripts and important common files (using Git). This gives me a consistent code base so I don't have to remember which host has which script or file (or version of what I'm looking for). Git is particularly well suited to supporting this mechanism and I've pretty much got in the habit of updating the master origin repo daily. Within the scripts (both Emacs and bash shell scripts) I use machine tailored code to handle local requirements. This system has been in place now for well over a year and I find it to be quite effective. This is a technique I've seen recommended for some number of years. I found it clunky with CVS and Subversion but git feels tailored for the job. That said, I like the solution you selected as a complimentary tool and look forward to adding that to the mix.