Is there a way to run these scripts from the :
commandline with a few keystrokes?
Over the last couple of months, I\'ve built a series of fi
Script or function? If it is a function, try
:call FunctionName()
Open Vim and enter the following:
:source /path/to/vim/file/name.vim
If you are currently editing that file, you can also type:
:w <ENTER>
:source % <ENTER>
The percent sign (%) means the path to the currently opened file.
:run file.vim
:run
is like :source
, but :run
doesn't need the path. It searches the runtimepath
.
A Linux runtimepath
:
$HOME/.vim,
$VIM/vimfiles,
$VIMRUNTIME,
$VIM/vimfiles/after,
$HOME/.vim/after
You could use the command
feature of vim. In your unit_test_cpp.vim
file you would add something like this:
command Utc call CreateUnitTests()
Now when you type :Utc
it will call your function. The only limitation is that your command must start with an uppercase letter.