Sunday, March 6, 2011

Re: using the help system in split screen mode

Reply to message «Re: using the help system in split screen mode»,
sent 23:13:02 06 March 2011, Sunday
by Benjamin R. Haskell:

> While testing, that's the kind of thing for which I'd set up something
> like ZyX's examples. (A 'reload' function/mapping.)
For testing purposes one can use frawor: a minimal example that will work:

%cat > ~/.vim/plugin/test.vim <<EOF
scriptencoding utf-8
if exists("s:_pluginloaded")
finish
endif
execute frawor#Setup('0.0', {}, 1)
EOF

Adding a new function:

function Function(arguments)
<...>
endfunction
" The key really does not matter, but I prefer to use the same key as the
" function name.
let s:_functions["Function"]=function("Function")

: just one line more then without frawor. Works with s:Function functions as
well.

Reloading plugin:
call frawor#Reload('plugin/test')
(plugin name is its path without leading rtp and trailing extension).

It is not everything that frawor can at this point, but it is stable enough,
while other features not.

Original message:
> On Sun, 6 Mar 2011, Chris Jones wrote:
> > While I'm at it.. I had to run a guinea pig Vim session that I could
> > easily bounce because I was unable to find a way to make Vim reload
> > the script. If you just source xxx.vim.. it sees that the 'load'
> > variable exists and exits immediately & you're stuck with the old
> > version.
> >
> > Is there any way to do that²..?
> >
> > [...]
> >
> > ² .. w/o modifying the script, naturally.
>
> Just unlet the variable. From your other response, it checked:
>
> if exists('loaded_HH')
> finish
> endif
> let loaded_HH=1
>
> So:
> :unlet loaded_HH | so xxx.vim
>
> While testing, that's the kind of thing for which I'd set up something
> like ZyX's examples. (A 'reload' function/mapping.)

No comments: