- 如题,记录下来
- 我试着用
+y
不知道为啥没成功 - 应用场景之一, 我在学习vim正则表达式指北dahu/VimRegexTutor: A vimtutor clone for learning Regular Expressions in Vim时,需要将vim的内容复制到命令行,就遇到了困难,用以下的做法就解决了。。。
Make quoteplus the default register
If you’d like to make it easier to interact with the system clipboard, try out this setting:
:set clipboard=unnamed
That tells Vim to use the system clipboard for all yank, delete, change, and put operations that have no register explicitly specified. In effect, the system clipboard becomes the default register.
Now if I run yy
to yank a line, that text appears in the system clipboard.
Beware that with this setting, Vim’s x
command will write a single character to the system clipboard, overwriting whatever was in there previously. That really irritates me, but being able to use a clipboard history browser makes it bareable.
–from: vimcasts.org/en.md at 20a28b4ae316fc809e055374b320312ac0fda3d2 · vimcasts/vimcasts.org