是否有任何方法复制所有行从打开的文件到VI编辑器剪贴板。我试过yG,但它没有使用剪贴板来存储这些行。
那么这可能吗?
是否有任何方法复制所有行从打开的文件到VI编辑器剪贴板。我试过yG,但它没有使用剪贴板来存储这些行。
那么这可能吗?
当前回答
我不能用上面的答案复制文件,但我有腻子,我在Quora上找到了一个解决办法。
更改您的PuTTY会话设置,进入日志并将其更改为“可打印字符”。设置日志文件 做猫各自的文件 转到步骤#1中设置的文件,日志文件中将包含您的内容。
注意:它将该会话的所有打印字符复制到日志文件中,因此它最终会变得很大。在这种情况下,删除日志文件并删除目标文件,以便将特定文件的内容复制到您的计算机上。
其他回答
gVim:
:set go=a
ggVG
看:help go-a:
'a' Autoselect: If present, then whenever VISUAL mode is started,
or the Visual area extended, Vim tries to become the owner of
the windowing system's global selection. This means that the
Visually highlighted text is available for pasting into other
applications as well as into Vim itself. When the Visual mode
ends, possibly due to an operation on the text, or when an
application wants to paste the selection, the highlighted text
is automatically yanked into the "* selection register.
Thus the selection is still available for pasting into other
applications after the VISUAL mode has ended.
If not present, then Vim won't become the owner of the
windowing system's global selection unless explicitly told to
by a yank or delete operation for the "* register.
The same applies to the modeless selection.
在vim或它的选项卡中复制整个文件吗
y G
然后移动到一个标签和粘贴
p
并对整个文件进行删减使用
d G
我在我的.vimrc中添加了以下一行
nnoremap <F5> :%y+<CR>
这允许我通过按F5(在命令模式下)将Vim中的所有文本复制到剪贴板。
我尝试了上面人们提到的一些命令。没有工作。 然后我找到了其中最简单的一个。
步骤1:vi <filename> 第二步:右键单击Putty窗口的标题栏 步骤3:选择“清除屏幕”(以避免复制SSH会话的其余部分) 第四步:再次右键单击并选择“复制所有到剪贴板”。
Use:
:%y+
扯断所有的线。
解释:
%以引用下一个命令来处理所有行 Y来拉这些线 +复制到系统剪贴板
注意:在Windows中,+和*是等价的,请看这个答案。