核心问题,影响最大的: (xterm-mouse-mode t)
我开了这个来支持终端的鼠标点击,但是发现复制粘贴不行了。终端里复制的内容在windows粘贴不出来
(set-face-background 'hl-line "#3e4400")
在终端里能生效正常的黄色,GUI反倒没变化了。。
;; -*- coding: utf-8; lexical-binding: t; -*-
;; Use the system clipboard
;; @see https://www.emacswiki.org/emacs/CopyAndPaste
;; So `C-y' could paste from clipbord if you are NOT using emacs-nox
;; I only use `paste-from-x-clipboard', not `C-y'.
(setq x-select-enable-clipboard t
x-select-enable-primary t)
;; kill-ring and clipboard are same? No, it's annoying!
(setq save-interprogram-paste-before-kill nil)
(defun copy-yank-str (msg &optional clipboard-only)
(unless clipboard-only (kill-new msg))
(my-pclip msg)
msg)
(defun cp-filename-of-current-buffer (&optional n)
"Copy file name (NOT full path) into the yank ring and OS clipboard.
If N is not nil, copy file name and line number."
This file has been truncated. show original
粘贴板看看陈斌的配置就好,我借鉴(C-v)了很多他的工作流
他用的是xclip
"Method to use to access the GUI's clipboard. │
Can be one of `pbpaste' for MacOS, `xclip' or `xsel' for X11, │
and `getclip' under Cygwin, or `emacs' to use Emacs's GUI code for that."
我msys2没有getclip,这是cygutils包里的,我编译cygutils发现缺少一个依赖popt从pacman下载不到, 我编译popt去发现官网下的tar.gz都打不开,,,用tar 命令打开失败tar.exe: Error opening archive: Error reading './popt-1.14.tar'
,用windows的7z软件能打开但是解压缩报错。。。
简而言之,我编译cygutils失败没有getclip可用,xclip方案不行了。
临时方案:我现在给xtrem-mouse-mode 绑定一个快捷键,需要粘贴出去的时候就关掉这个mode去粘贴,需要鼠标的时候就打开这个ode。