Pasting styled text from the system clipboard
In vim, how can a person paste styled text from the system clipboard rather than plain text?
For example, copying from a web browser and pasting into a word processor typically results in styled text, including basic formatting (bold) and links being pasted. How can a person copy from the browser in the same way, but paste the original HTML representation of the text into vim?
+3
source to share
3 answers
Temporarily adding the parameter html
to clipboard
should help:
set clipboard^=html
put +
set clipboard-=html
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.
+6
source to share