Vim Tips Wiki
Register
(Change to TipImported template + severe manual clean)
(Move categories to tip template)
Line 9: Line 9:
 
|version=6.0
 
|version=6.0
 
|rating=80/22
 
|rating=80/22
  +
|category1=VimL
  +
|category2=
 
}}
 
}}
 
When you edit Vim script you often need to make a small change, then test some function, then make some another small change and so on. It is not convenient to restart Vim every time, and it is not convenient to run it from Ex command line.
 
When you edit Vim script you often need to make a small change, then test some function, then make some another small change and so on. It is not convenient to restart Vim every time, and it is not convenient to run it from Ex command line.
Line 26: Line 28:
   
 
----
 
----
[[Category:VimL]]
 

Revision as of 09:17, 25 April 2008

Tip 1229 Printable Monobook Previous Next

created May 12, 2006 · complexity intermediate · author DO · version 6.0


When you edit Vim script you often need to make a small change, then test some function, then make some another small change and so on. It is not convenient to restart Vim every time, and it is not convenient to run it from Ex command line.

So, it is reasonable to make 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:

:so %