从 emacs 调用 vim 或 TextMate
我已经使用 vi 有一段时间了,使用 Mac 时,我有时会使用 TextMate,最后,我发现了 emacs 的伟大之处。而且,我很可能会选择 emacs。
问题是,我有时需要其他(vi/TextMate)编辑器来做一些事情。并不是说 emacs 没有该功能,而是我现在需要该功能,并且我知道如何使用“其他”编辑器来做到这一点。另一位编辑也是如此。
我的问题是如何从另一个编辑器启动一个编辑器。这不仅仅是启动一个应用程序,而是使用我正在编辑的文件启动一个应用程序。
- 如何从 emacs 启动 vi 或 TextMate(mate)?
- 如何从 vi 启动 emacs 或 mate?
- 如何从 TextMate 启动 vi 或 emacs?
添加
在 Jérôme Radix 回答之后,我想出了以下命令。
(defun runmate () (interactive) (runeditor "/Users/smcho/bin/mate")) (defun runeditor (editor) (let (filename (file-truename buffer-file-name)) (setq cmd (format "%s %s" editor (file-truename buffer-file-name))) (save-window-excursion (async-shell-command cmd))))
I've been using vi quite a while, and with a Mac, I sometimes use TextMate, and finally, I found the greatness of emacs. And, it's very likely that I settle in emacs.
The problem is, I sometimes need the other (vi/TextMate) editor for doing something. It's not that emacs doesn't have the feature, it's just that I need the feature right now, and I know how to do that with the 'other' editor. And the same is true with the other editor.
My question is how can I launch the one editor from the other. It's not just launching an app, but launching an app with the file that I'm editing.
- How can I launch vi or TextMate(mate) from emacs?
- How can I launch emacs or mate from vi?
- How can I launch vi or emacs from TextMate?
ADDED
After Jérôme Radix's answer, I came up with the following command.
(defun runmate () (interactive) (runeditor "/Users/smcho/bin/mate")) (defun runeditor (editor) (let (filename (file-truename buffer-file-name)) (setq cmd (format "%s %s" editor (file-truename buffer-file-name))) (save-window-excursion (async-shell-command cmd))))
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如何从 emacs 启动 vi 或 TextMate(mate)?
要启动 TextMate,您需要安装 TextMate 的命令行工具,然后从 emacs 启动,这是(thx Chetan):
但最好的办法是就是同时打开所有3个编辑器并在它们之间切换。
How can I launch vi or TextMate(mate) from emacs?
to launch TextMate, you need to install TextMate's command line tools, and then from emacs, it's (thx Chetan):
But the best thing to do is to open all 3 editors at the same time and switch between them.