yank

How can I save a block in Visual Mode to a file in VIM?

The title is very description. Just in case, I will take an example: START BLOCK1 something END BLOCK1 START BLOCK2 something somenthing... END BLOCK2 I select the BLOCK1 in visual mode I yank it by pressing "y" How can I save the yanked BLOCK1 to some other file? ...

Yank file name / path of current buffer in Vim

Assuming the current buffer is a file open for edit, so :e does not display E32: No file name. I would like to yank one or all of: The file name exactly as show on the status line, e.g. ~\myfile.txt A full path to the file, e.g. c:\foo\bar\myfile.txt Just the file name, e.g. myfile.txt ...

Vim yanking range of lines

Hello Everyone! This is my first post on stack, so please bear with me. I'm a C# developer who has just recently decided to expand my knowledge of the tools available to me. The first tool I've decided to learn is Vi/Vim. Everything has been going well so far, but there are a couple of questions I can't seem to find the answer to: 1...

Vim: Replace selection with default buffer without overwriting the buffer.

Here is my problem: I am in visual mode. I select text and copy it to the buffer. ((y)ank) I select another text which I want to replace and paste the buffer. ((p)aste) Now the second selection has been replaced in the buffer, however I want the first one to still sit in there. Any ideas? ...