0

I started to use macvim not only for code, but also for editing a wiki and academic writing in LaTeX. After several honeymoon moments ;-) and first customization efforts, I found a problem I can't solve:

How do I paste content from the system clipboard within a line, no matter where this content is copied from? (I use LaunchBar’s multi clipboard feature quite excessively and store mostly > 20 strings from different applications I will paste sooner or later. It works well with macvim, but not when it comes to "linewise" content.) p or P create newlines, cmd-v as well.

I neither want to add strings between tags, nor focus on other specialised settings.

Community
  • 1
  • 1
lejonet
  • 195
  • 3
  • 10

2 Answers2

3

I don't know how Launchbar works in this regard but all the clipboard managers I've used send a Cmd-v when you hit Enter.

MacVim, being very well integrated in the system, supports many default Mac OS X shortcuts like Cmd-o, Cmd-s or Cmd-v so… simply selecting the item in Launchbar's list and hitting Enter should work.

If your pasted content ends up on a line of its own (presumably above the current line) instead of in the middle of your sentence that means that the pasted text contains a new line, plain and simple. Because MacVim maps Cmd-v to P, the pasted content is pasted before the cursor: inline if there's no newline in sight, above the current line if there are newlines.

That's normal behavior.

At that point, either you find a way to clean Launchbar's content up before Cmd-v or you edit the pasted text afterward with something like ^v$y"_d<movement>P.

romainl
  • 186,200
  • 21
  • 280
  • 313
0

p and P only create new lines if the clipboard contains a newline character.

I just pasted one-line content from my clipboard into vim and it worked fine (in-line).

The issue may be with the way LaunchBar is copying to its clipboards.

jahroy
  • 22,322
  • 9
  • 59
  • 108