ReloadScript : Reload a VIM script during script development.
| script karma |
Rating 17/7,
Downloaded by 1212
|
Comments, bugs, improvements
|
Vim wiki
|
| created by |
| Ingo Karkat |
| |
| script type |
| utility |
| |
| description |
DESCRIPTION
Re-sources a Vim script. The script may use a multiple inclusion guard
variable g:loaded_{scriptname} (with {scriptname} having either the same case
as specified or all lowercase.)
If you specify the bare scriptname (without .vim extension), the script must
reside in $VIMRUNTIME/plugin/{scriptname}.vim. Otherwise, the passed filespec
is interpreted as the file system location of a Vim script and sourced as-is.
If you execute :ReloadScript without passing a scriptname, the current buffer
is re-sourced.
USAGE
ReloadScript Re-sources the current buffer.
ReloadScript {scriptname} Re-sources the passed plugin script.
ReloadScript {path/to/script.vim} Re-sources the passed file.
ASSUMPTIONS
Not every script supports reloading. There may be error messages like
"function already exists". To support reloading, the script should use the
bang (!) variants of :function! and :command!, which will automatically
override already existing elements.
Ensure that the script uses a multiple inclusion guard variable that conforms
to the conventions mentioned above. The :ReloadScript command will issue a
warning if it cannot find the inclusion guard variable. |
| |
| install details |
INSTALLATION
This script is packaged as a vimball. If you have the "gunzip" decompressor
in your PATH, simply edit the *.vmb.gz package in Vim; otherwise, decompress
the archive first, e.g. using WinZip. Inside Vim, install by sourcing the
vimball or via the :UseVimball command.
vim ReloadScript*.vmb.gz
:so %
To uninstall, use the :RmVimball command.
DEPENDENCIES
- Requires Vim 7.0 or higher. |
| |
script versions (upload new version)
Click on the package to download.
| ReloadScript-1.21.vmb.gz |
1.21 |
2012-08-28 |
7.0 |
Ingo Karkat |
- Avoid <f-args> because of its unescaping behavior.
- Also no global inclusion guard for ftdetect scripts. |
| ReloadScript.vba.gz |
1.20 |
2011-01-09 |
7.0 |
Ingo Karkat |
- BUG: Avoiding "E471: Argument required" error on empty buffer name.
- ENH: Explicitly checking for the existence of the file, as we don't want to put the :source command inside try...catch (it would stop showing all resulting errors and show only the first), and because :runtime doesn't complain at all.
- Added separate help file and packaging the plugin as a vimball. |
| ReloadScript.vim |
1.10.005 |
2008-07-29 |
7.0 |
Ingo Karkat |
Combined missing inclusion guard warning with reload message to avoid the "Hit ENTER" prompt.
No missing inclusion guard warning for scripts that do not need one (e.g. after-directory, autoload, ftplugin, indent, syntax, ...) |
| ReloadScript.vim |
1.10.004 |
2008-02-28 |
7.0 |
Ingo Karkat |
A scriptname argument with path and/or extension is sourced as-is. This allows a third usage: :ReloadScript path/to/script.vim |
| ReloadScript.vim |
1.00.003 |
2007-05-22 |
7.0 |
Ingo Karkat |
Initial upload |
ip used for rating: 23.22.76.170
|