News for hackers. Stuff that matters.
Re:Everyone Who Tried to Convince Me to Use Vim Was Wrong by rlpb on Thursday July 29, 2010 @08:00AM (#1557281)
If I understand your problem correctly, you want to use registers. Say you yank a text visually by using V, the arrow keys, and then y. Instead, use V, the arrow keys, then "ay

That stores the yanked text into the "a" register. When you put, instead of just p, use "ap

That puts from the "a" register, and you can repeat the action since the register is never overwritten unless you tell it to. You can also use b through to z to store other things. The same registers can also be used to store macros and marks.

Usually you use the default register (I think it's ") and this register also gets various stuff saved to it automatically (eg. stuff you delete). (This is how stuff like xp to swap the current and next character works)

Re:Everyone Who Tried to Convince Me to Use Vim Was Wrong by barfoomoo on Thursday July 29, 2010 @08:25AM (#1557327)
Thanks for that suggestion. Any idea why Vim behaves like this? Say I visually select something and yank it and then go on pressing p it pastes the yanked text any no of times. But, if I select a text and then try to replace it with the yanked text, I can do it only once. The next time, the yanked text seems to be removed from the register. Why this difference in behavior?
Re:Everyone Who Tried to Convince Me to Use Vim Was Wrong by mileszs on Thursday July 29, 2010 @08:54AM (#1557388)
When you select some text and 'put' over it, Vim yanks the selected text into the default register. The text that you just put is still put-able via "2p, if you'd like to put it again. Vim is essentially saving that selected text for you, just in case.

I hope that answers your question.

Re:Everyone Who Tried to Convince Me to Use Vim Was Wrong by dhimes on Thursday July 29, 2010 @09:20AM (#1557438)
If that doesn't answer it, do a little editing then :reg You'll see what's going on from there.
Re:Everyone Who Tried to Convince Me to Use Vim Was Wrong by barfoomoo on Thursday July 29, 2010 @10:17AM (#1557615)
Thanks for the replies.
Re:Everyone Who Tried to Convince Me to Use Vim Was Wrong by pyre on Thursday July 29, 2010 @06:46PM (#1559586)

  > That puts from the "a" register, and you can repeat
  > the action since the register is never overwritten
  > unless you tell it to. You can also use b through
  > to z to store other things.
The '+' register is used to interface with the X11 (or Windows) clipboard. Example:

  "+P   Paste from clipboard
  "+y   Yank to clipboard
  "+gP  Paste from clipboard, move cursor to end of pasted text