I can source a file, e.g. my
:so % or
:so <filename>. But what do I do when I need to source only part of a file. I want some way to visually select a portion of the file with
:h v and then source it. Kinda like emacs's
After you've done your Visual selection run this:
y copies the selection to the unnamed register (
") since we didn't explicitly name a register. Then
:@" executes the contents of that register as Ex commands.