Thread: about vim dd dw dl

  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,218
    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