从系统剪贴板粘贴样式文本

Alk*_*ini 3 vim copy-paste

在vim中,一个人如何从系统剪贴板而不是纯文本中粘贴样式文本?

例如,从web浏览器和粘贴在复制到字处理器通常导致样式的文本,包括基本格式(粗体)和链接被粘贴.一个人如何以相同的方式从浏览器复制,但将文本的原始HTML表示粘贴到vim?

ZyX*_*ZyX 6

临时添加htmlclipboard选项应该有所帮助:

set clipboard^=html
put +
set clipboard-=html
Run Code Online (Sandbox Code Playgroud)
  html            When the clipboard contains HTML, use this when
                  pasting.  When putting text on the clipboard, mark it
                  as HTML.  This works to copy rendered HTML from
                  Firefox, paste it as raw HTML in Vim, select the HTML
                  in Vim and paste it in a rich edit box in Firefox.
                  You probably want to add this only temporarily,
                  possibly use BufEnter autocommands.
                  Only supported for GTK version 2 and later.
                  Only available with the |+multi_byte| feature.
Run Code Online (Sandbox Code Playgroud)


rom*_*inl -1

Vim 不支持富文本:它是一个文本编辑器,而不是文字处理器。

  • 小心古怪的行为;您忽略了一点,在某些情况下,“富文本”实际上是文本编辑器可以完美处理的纯文本。 (3认同)