How can I save a text block in visual mode to a file in Vim?

后端 未结 8 2149
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-23 18:54

The title is very descriptive. Just in case, I will give an example:

START BLOCK1
something
END BLOCK1

START BLOCK2
something
somenthing...
END BLOCK2
         


        
8条回答
  •  一向
    一向 (楼主)
    2020-12-23 19:26

    Similar to @songz's solution, I prefer do it like this using ":new"

    vmap  y:new ~/.vimbufVGp:x:!pbcopy < ~/.vimbuf
    

提交回复
热议问题