在tmux中使用emacs时的鼠标控制

时间:2016-04-14 10:34:30

标签: macos emacs mouse tmux

我尝试在Terminal.app中使用Emacs和tmux,并且难以让鼠标正常工作。

如果我使用tmux的Emacs ,那么我可以使用鼠标点击文本跳转到缓冲区。

但是,如果我在tmux中,并且我开始在Emacs中编辑文件,那么我无法点击。我要做     M-x load-file~ / .emacs.d / init.el ..让它发挥作用。

以下是 init.el

的内容
(require 'package) ;; You might already have this line

(when (< emacs-major-version 24)
  ;; For important compatibility libraries like cl-lib
  (add-to-list 'package-archives '("gnu" . "http://stable.gnu.org/packages/")
                             '("melpa" . "http://melpa.org/packages/")))
(package-initialize) ;; You might already have this line

;; magit
(global-set-key (kbd "C-x g") 'magit-status)
(global-set-key (kbd "C-x M-g") 'magit-dispatch-popup)

(global-set-key (kbd "C-c SPC") 'ace-jump-mode)

;; mouse
;; enable mouse reporting for terminal emulators
(unless window-system
  (xterm-mouse-mode 1)
  (global-set-key [mouse-4] (lambda ()
                  (interactive)
                  (scroll-down 1)))
  (global-set-key [mouse-5] (lambda ()
                  (interactive)
                  (scroll-up 1))))

..和我的 tmux.conf

set -g mouse on
bind X confirm-before kill-session
bind C-s set-window-option synchronize-panes
bind r source-file ~/.tmux.conf \; display "Reloaded!"

set -g window-active-style 'fg=colour250,bg=black'

bind -t emacs-copy C-WheelUpPane   halfpage-up
bind -t emacs-copy C-WheelDownPane halfpage-down


# plugins
set -g @plugin 'nhdaly/tmux-scroll-copy-mode'


run '~/.tmux/plugins/tpm/tpm'

版本

tmux version 2.1
emacsclient 24.5
macOS 10.11.4 

1 个答案:

答案 0 :(得分:0)