首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在tmux中使用emacs时鼠标控制

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

Stack Overflow用户
提问于 2016-04-14 10:34:29
回答 1查看 891关注 0票数 1

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

如果我在tmux的外部使用Emacs ,那么可以使用鼠标单击文本来跳过缓冲区。

但是,如果我在tmux中,并且开始编辑Emacs中的文件,那么我就不能点击周围。我必须做M加载文件~/ . emacs.d/init.el .才能让它起作用。

这是我的init.el的内容

代码语言:javascript
复制
(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))))

..and my tmux.conf

代码语言:javascript
复制
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'

版本

代码语言:javascript
复制
tmux version 2.1
emacsclient 24.5
macOS 10.11.4 
EN

回答 1

Stack Overflow用户

发布于 2019-02-12 07:14:47

这对我起了作用:

代码语言:javascript
复制
(xterm-mouse-mode 1)

https://unix.stackexchange.com/questions/252995/how-can-mouse-support-be-enabled-in-terminal-emacs/406519#406519

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/36620518

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档