k-vim
k-vim copied to clipboard
希望设置和系统剪贴板交互的快捷键
建议代码:
" ,c 复制至公共剪贴板
vmap
" ,a 复制所有至公共剪贴板
nmap
" ,v 从公共剪贴板粘贴
imap
9.0版本暂不解决, 没找到满意的键位/插件 其实很早之前引入yankring的
https://github.com/vim-scripts/YankRing.vim https://github.com/svermeulen/vim-easyclip
待处理
参考spf13:
" share system clipboard
if has('clipboard')
if has('unnamedplus') " When possible use + register for copy-paste
set clipboard=unnamed,unnamedplus
else " On mac and Windows, use * register for copy-paste
set clipboard=unnamed
endif
endif
现在好像原生的 "+y 和 "+p 也无法复制粘贴吗?
@yangjiandong 这一段代码的作用是什么?用起来好像把 "+y / "+p 映射成文件内的复制粘贴了?
set clipboard=unnmaed
之后就可以用y来复制到公共粘贴版
p来粘贴了
- archlinux wiki The vim* packages are built with no X support. As a consequence, the +clipboard feature is missing, so Vim will not be able to operate with the X11 primary and clipboard buffers. The gvim* packages provide also CLI version of Vim with full X support. --( archlinux wiki )
- gentoo wiki Link console vim against X11 libraries to enable title and clipboard features in xterm
USE=X emerge vim
" share system clipboard
if has('clipboard')
if has('unnamedplus') " When possible use + register for copy-paste
set clipboard=unnamed,unnamedplus
else " On mac and Windows, use * register for copy-paste
set clipboard=unnamed
endif
endif
$ vim --version | grep clipboard
+
前缀表示拥有的feature,-
前缀表示未拥有。如果显示的是 + clipboard
就表示支持系统剪切板。
我建议 @wklken 可以在配置文件里默认全局都是vim与系统剪切板交互:
set clipboard=unnamed
个人觉得这样比较方便些。