Paste multiple lines before a line in vim?

Posted by Umar on Super User See other posts from Super User or by Umar
Published on 2012-12-06T04:36:23Z Indexed on 2012/12/06 5:08 UTC
Read the original article Hit count: 560

Filed under:
|

How do I copy multiple lines and paste them as a block before a line? As an example I have the following code and I want to copy and paste the three lines after the if statement to after the else statement but before the line below it.

[row col] = find(H);  
if (nargin < 4)    

    delqmn = sparse(row, col, 0, M, N); % diff of msgs from bits to checks
    delrmn = sparse(row, col, 0, M, N);% diff of msgs from checks to bits
    rmn0 = sparse(row, col, 0, M, N);% msgs from checks to bits (p=0)
else

// Insert 3 lines after if statement here

qn0 = 1-r;% pseudoposterior probabilities
qn1 = r;% pseudoposterior probabilities

Thanks

© Super User or respective owner

Related posts about vim

Related posts about gvim