Say I\'m editing my _vimrc
file and I\'ve just added a couple of lines, for instance a new key mapping. I don\'t want to reload the whole file (:so %
Executing the line under cursor as an Ex command:
:execute getline(".")
Convenient enough for 2 lines. (I'd figure out something for doing it with regions, but I'm not a vim user). And for currently selected region, the following seems to do the job:
:execute getreg("*")
As commented by Peter Rincker, this mapping can be used for executing the currently selected lines:
:vnoremap :exe join(getline("'<","'>"),'')