I have a section
in file1
which should be moved to file2
. Normally I'd do this by visually-selecting the block, deleting it, :wq
from file1
, open file2
, then paste.
Is there an easy way to move a block of text from file
to file2
without closing vim
?
You could open your new file in a split using :sp newfile
and then delete the block as normal from your first file. Then, change to the other split with ctrl w and w. Then use p
to put the deleted content into the other file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With