LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Silly vim question (https://www.linuxquestions.org/questions/linux-software-2/silly-vim-question-434479/)

Valhalla 04-12-2006 10:10 AM

Silly vim question
 
One of my friends suggested that I start learning vim, and because I have an abundance of time on my hands, I decided I would, and have since enjoyed learning immensly. However, one of the commands I came across that would be useful is yanking or cutting text into registers. The instruction manual said that if I wanted to yank a line into register a, I would just hit ayy. However, this throws me into insert mode at the end of the line and inserts yy. Similarly, b already means something else as well. Did I misunderstand the instructions, or is there an extra step involved. I was fairly certain there are 26 named registers that correspond to letters. Anyway, thanks for any help.

geeman2.0 04-12-2006 10:25 AM

The human mind tends to ignore quotation marks in commands because it looks like the command is being quoted.

You need to type "ayy
Not ayy.

Then to paste, "ap

a on its own of course means append and insert mode.

druuna 04-12-2006 10:25 AM

Hi,

That (ayy) should be "ayy.

To place buffer content (a in this example) before cursor: "aP
To place buffer content after cursor: "ap

BTW: They are called buffers, not registers ;)

Hope this clears things up.

Valhalla 04-12-2006 02:38 PM

Thank you both. A whole bunch of things just got much easier.


All times are GMT -5. The time now is 02:40 AM.