Vimでbufferの内容を全てyankする時には、
Yank to unnamed register.
ggVGy
Yank to clipbord.
ggVG"+y
とやっていたが、これは困る。gg
で、cursorが先頭行へ移動してしまう。
普通のtext editorで、Ctrl+a Ctrl+c
とやるような事をやりたい訳である。此れには:y
commandを使う。bufferの全てをrangeとして指定するので、:%y
と成る。
Yank to unnamed register.
:%y<Enter>
Yank to clipbord.
:%y+<Enter>
Yank to named register "a".
:%y a<Enter>
:help :y
を読む事。
cf. [Copy an Entire Buffer to the Clipboard - Vim Tips Wiki http://vim.wikia.com/wiki/Copy_an_Entire_Buffer_to_the_Clipboard ]
cf. [Accessing the system clipboard - Vim Tips Wiki http://vim.wikia.com/wiki/Accessing_the_system_clipboard ]
cf. [バッファ全体をコピーする #Vim - Qiita http://qiita.com/items/1d46e00819538ae0b420 ]