Skip to content

Comment on Pasting in command line Vim doesn't have to suck

Comments

perhaps, I'm forgetting something, but these solutions seem overly complicated.

I just have this in my .vimrc, and pasting (with formatting), is as simple as copying text, going to vim and hitting 'p' in command mode.

  for middle-click (system) clipboard:
    :set clipboard=unnamed
  for ctrl-c (X11) clipboard:
    :set clipboard=unnamedplus

  couple caveats:
  * +xterm_clipboard
  * 'unnamedplus' is only for >= 7.3.74 
see here for more info http://vim.wikia.com/wiki/Accessing_the_system_clipboard

note: I used unnamedplus for a bit, but found it to be much less desirable than using the unnamed middle-click buffer...YMMV

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.