vim Register 操作,拷贝至系统剪贴板等

https://stackoverflow.com/questions/1497958/how-do-i-use-vim-registers

https://vi.stackexchange.com/questions/84/how-can-i-copy-text-to-the-system-clipboard-from-vim

https://stackoverflow.com/questions/3997078/how-to-paste-yanked-text-into-the-vim-command-line/3997110#3997110

1.  "a : " + 字母/数字 即为使用该寄存器

对应于系统剪贴板的寄存器:星号,或加号 :

  • * uses PRIMARY; mnemonic: Star is Select (for copy-on-select)
  • + uses CLIPBOARD; mnemonic: CTRL PLUS C (for the common keybind)

其他特殊寄存器:

https://stackoverflow.com/questions/3997078/how-to-paste-yanked-text-into-the-vim-command-line/3997110#3997110

  • 0 (yank register: when you use y in normal mode, without specifying a register, yanked text goes there and also to the default register),
  • 1 to 9 (shifting delete registers, when you use commands such as c or d, what has been deleted goes to register 1, what was in register 1 goes to register 2, etc.),
  • " (default register, also known as unnamed register. This is where the " comes in Ctrl-R"),
  • a to z for your own use (capitalized A to Z are for appending to corresponding registers).
  • _ (acts like /dev/null (Unix) or NUL (Windows), you can write to it but it's discarded and when you read from it, it is always empty),
  • - (small delete register),
  • / (search pattern register, updated when you look for text with /?* or # for instance; you can also write to it to dynamically change the search pattern),
  • : (stores last VimL typed command via Q or :, readonly),
  • + and * (system clipboard registers, you can write to them to set the clipboard and read the clipboard contents from them)

2. 寄存器 + 动作(y/d等)+ 移动位置: 把对应内容拷贝到相应寄存器

"kyy
把相应内容拷贝到k寄存器
https://stackoverflow.com/questions/1497958/how-do-i-use-vim-registers

原文地址:https://www.cnblogs.com/imoon22/p/15358488.html