如何在终端与Emacs间无缝切换?

虽然Emacs中的shell很好用,但是更多时候还是要用终端的,那么GUI的emacs怎么和终端进行迅速的切换呢?

点一下鼠标?

Purcell 入是说。

为啥要来回切?编译调试写个 Makefile/projectile 啊

我是用 elisp 调用 AppleScript ,跳转到 iterm2 中当前 buffer 所处文件夹下

以下是我的代码:

(defun memacs//switch-to-item2-run-command(CMD)
  "Open item2 run command CMD."
  (do-applescript
   (format "
          tell application \"iTerm\"
            activate
            try
              select first window
            on error
              create window with default profile
              select first window
            end try
            tell the first window
              tell current session to write text \"%s\"
            end tell
          end tell" CMD))
  )

(defun memacs/switch-to-item2-on-dir-of-current-buffer()
  "Open item2 then cd into the path of the directory of
current buffer."
  (interactive)
  (memacs//switch-to-item2-run-command
   (concat
    "cd "
    (replace-regexp-in-string "\\\\" "\\\\\\\\"
                              (shell-quote-argument
                               (or default-directory "~")))))
  )

点一下鼠标……

我之前用iterm2的全局快捷键,现在终端用的少了,为了节省快捷键,我把iterm的删了,平时直接手动切换

推荐看一下这个repo:https://github.com/jasonrudolph/keyboard 可以自定义app打开的快捷键,iterm2的话是“右alt+t“。

hammerspoon 自定义快捷键吧