In vim, how might a person paste styled text from the system clipboard rather than the plain-text?
For example, copying from a web browser and pasting in to a word processor typically results in styled text, including basic formatting (bold) and links, being pasted. How might a person copy from the browser in the same way but paste the original HTML representation of the text in to vim?
To paste without formatting, press Ctrl+Shift+V instead of Ctrl+V. This works in a wide variety of applications, including web browsers like Google Chrome.
Keyboard shortcuts To apply the formatting you copied to a different text selection: Press Ctrl + Alt + v (Windows or Chrome OS) or ⌘ + Option + v (Mac).
Use Ctrl + Alt + V (or Cmd + Alt + V on a Mac) to open the Paste Special window. Here, select Unformatted Text to paste in plain text. Finally, if you'd like, you can set the default paste option in Word to always paste in plain text.
Temporary adding html
to clipboard
option 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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With