Vim Tips Wiki
Advertisement

Previous TipNext Tip

Tip: #1229 - Source current file when editing a script

Created: May 12, 2006 4:04 Complexity: intermediate Author: DO_ Version: 6.0 Karma: 80/22 Imported from: Tip#1229

When you edit VIM script you often need to make small change, then test some function, then make some another samll change and so on. It is not convinient to restart VIM every time, and it is not convinient to run it from EX command line too.

So, it is reasonable to make such a mapping:

noremap <silent><buffer> <F9> :exec 'source '.bufname('%')<CR> 


You may to place this line into file {runtimepath}/ftplugin/vim.vim, to use this mapping for VIM files only.

Comments

It is quite convenient to run it from a command line. This would do it:

:so %

Anonymous , May 12, 2006 12:25


Advertisement