linux - vim: copy and paste text without looking into the line number -


For example, I want to copy line 5 ~ 15 and paste it to another location. I find several ways:

  1. Move your cursor to row 5, then 11yy , and p
  2. Command: Select the block within 5,15 y and p
  3. Ctrl + V, row 5 ~ 15, then go to that location Where you want to paste, leave enough blank rows to paste (or it will overlap with the current text), and p

    I'm not satisfied with any method Method 1 and 2, do not line me up The number will be counting or counting how many lines I want to copy, when the text is included in many lines, it becomes very difficult for method 3, I have to be able to have enough space ahead of me, which lines me It is also possible to count those that I want to paste. So is there any way that is like method 3, just before I do not have to leave enough space?


    Edit: Method 2, the original 5,15 yy is incorrect <3p>

    There will be a way to do the same as your 3.

    1. Go to line-5, then V15Gy or V10jy or Vjjj ... jy ( V is towards visual mode line. You can see your selected line without boarding about the number of lines)

    2. Line-40 (or somewhere And) and p . It will line up the line after 40 -40 lines. Or use P to place it before the line-40

      or you can use the Ex-command : t (Like : copy but less)

      : 5,15 T 40

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -