about vim dd dw dl

This is a discussion on about vim dd dw dl within the Linux Programming forums, part of the Platform Specific Boards category; each time ,when I delete some code,the copy buffer will be replaced by the deleted word. for example: 1 #if ...

  1. #1
    Registered User
    Join Date
    Dec 2011
    Posts
    9

    about vim dd dw dl

    each time ,when I delete some code,the copy buffer will be replaced by the deleted word.
    for example:
    1 #if 0
    2 #include <stdio.h>
    when I move to 1,press [yy],vim will copy this line to buffer,when I press [p],line 1 will be paste ,
    but if I move to line 2,use [dd],the line 2 will replace the line 1 in buffer,and each time I press [p] key,line 2 will be paste,

    I just want to paste line 1, how to configure it ?(my enviroment is fedora 15)

  2. #2
    Registered User
    Join Date
    Aug 2003
    Posts
    1,203
    That is because in vim dd is equivalen to "cut entire line" while yy is "copy entire line". delete a line without editing the buffer you can use the following sequence: "_d
    note that the quotationmark needs to be there (this selects the buffer you want to use)

Popular pages Recent additions subscribe to a feed

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21