Spacemacs里选中文字不能使用中键粘贴

linux系统里,emacs选中文字,就可以中键粘贴了。百度下面的参考文章,也说emacs默认支持。 spacemacs怎么不行?

参考文章: linux剪贴板原理 - LaoKa - 51CTO技术博客 http://laokaddk.blog.51cto.com/368606/945304/

结论(待确认,家里没linux系统环境试验)[已解决,linux下正常,而且能够显示变量x-select-enable-primary值]: 与两个变量有关 x-select-enable-clipboard。spacemacs里是默认为t x-select-enable-primary。spacemacs里c-h v里搜索不到这个变量描述 但是根据common-win.el里的代码定义,应该是

(setq x-select-enable-primary t)

参考内容–来自spacemacs帮助

x-select-text is a compiled Lisp function in `common-win.el'.

(x-select-text TEXT)

Select TEXT, a string, according to the window system.

On X, if `x-select-enable-clipboard' is non-nil, copy TEXT to the
clipboard.  If `x-select-enable-primary' is non-nil, put TEXT in
the primary selection.

On MS-Windows, make TEXT the current selection.  If
`x-select-enable-clipboard' is non-nil, copy the text to the
clipboard as well.

On Nextstep, put TEXT in the pasteboard (`x-select-enable-clipboard'
is not used).

x-select-enable-clipboard is a variable defined in `common-win.el'.
Its value is nil
Original value was t

Documentation:
Non-nil means cutting and pasting uses the clipboard.
This is in addition to, but in preference to, the primary selection.

Note that MS-Windows does not support selection types other than the
clipboard.  (The primary selection that is set by Emacs is not
accessible to other programs on MS-Windows.)

This variable is not used by the Nextstep port.

You can customize this variable.

This variable was introduced, or its default value was changed, in
version 24.1 of Emacs.

补充一份网上资料:EmacsWiki: Copy And Paste https://www.emacswiki.org/emacs/CopyAndPaste

建议用 emacs -Q 不加载任何配置看看你所查看的资料是否有效,然后看看 spacemacs 的中键绑定的函数是否正确被调用。如果还有问题,可以考虑去 spacemacs 官方仓库去提 issue.

linux下的spacemacs按照我的方法是可以的。 windows只是显示不出变量 x-select-enable-primary 的值。 总之,问题已经解决。谢谢关注