从emacs调用vim或TextMate [英] Calling vim or TextMate from emacs

查看:109
本文介绍了从emacs调用vim或TextMate的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在使用vi,而在Mac上,我有时候使用TextMate,最后我发现了emacs的伟大。而且,我很可能在emacs中定居。



问题是,我有时需要其他(vi / TextMate)编辑器来做某事。这不是emacs没有这个功能,只是我现在需要这个功能,我知道如何用其他编辑器来做。另一个编辑器也是如此。



我的问题是如何从另一个编辑器启动一个编辑器。它不只是启动一个应用程序,而是启动一个我正在编辑的文件的应用程序。




  • 如何启动vi或TextMate emacs的配合?

  • 如何从vi启动emacs或配对?

  • 如何从TextMate启动vi或emacs?



ADDED



在JérômeRadix的回答之后,我想出了以下命令。

($)
(defun runmate()
(interactive)
(runeditor/ Users / smcho / bin / mate))

(defun runeditor(editor)
(let(filename(file-truename buffer-file-name))
(setq cmd(格式%s% s编辑器(file-truename buffer-file-name)))
(save-window-excursion
(async-shell-command cmd))))


解决方案

如何从emacs启动vi或TextMate(mate)?

 (async-shell-commandvi);;从Emacs 23.2 

(shell-commandvi&);;在Emacs之前23.2

要启动TextMate,您需要安装TextMate的命令行工具,然后从emacs,它是(thx Chetan):

 (async-shell-commandmate);;从Emacs 23.2 

(shell-commandmate&);;在Emacs之前23.2

但最好的办法是同时打开所有3个编辑器并切换之间。


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))))

解决方案

How can I launch vi or TextMate(mate) from emacs?

(async-shell-command "vi")  ;; From Emacs 23.2

(shell-command "vi &")  ;; Before Emacs 23.2

to launch TextMate, you need to install TextMate's command line tools, and then from emacs, it's (thx Chetan):

(async-shell-command "mate") ;; From Emacs 23.2 

(shell-command "mate &") ;; Before Emacs 23.2

But the best thing to do is to open all 3 editors at the same time and switch between them.

这篇关于从emacs调用vim或TextMate的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆