vim-reload icon indicating copy to clipboard operation
vim-reload copied to clipboard

I do not think the plugin is working.

Open symbolix opened this issue 9 years ago • 2 comments

Hi,

I have a simple scenario where I would like to reload a script that contains a function and a command mapping. I have installed the vim-reload plugin however I do not see the changes taking place once I run ReloadScript for the currently open script. Any ideas?

symbolix avatar Jul 05 '15 16:07 symbolix

  1. Are you running the literal command :ReloadScript or are you giving the command a filename to reload as an argument? (two different modes of operation and knowing the difference may point out where the problem is)
  2. Do you get any messages when running the :ReloadScript command? (this would tell us the plug-in is at least trying to reload your Vim script)
  3. Are you sure that the Vim script you're working on was loaded (sourced) before you tried to reload it? You can verify by checking that its filename appears in the output of the :scriptnames command.
  4. Does using Vim's :source command properly reload your script?

xolox avatar Jul 08 '15 17:07 xolox

Hi,

I have made a simple function just as a test purpose:

function! MyFunc(myarg1, myarg2)    
    echom "(DEBUG) Incoming aguments: " . a:myarg1 . ", " . a:myarg2
endfunction

then linked it to a command: command! -nargs=* HookMyFunc call MyFunc(<f-args>)

assigned a key: nmap <silent> <leader>z <Plug>MyHook

and defined a Plug: `nnoremap <Plug>MyHook :execute 'HookMyFunc ' . g:my_var_a . ' ' . g:my_var_b<CR>``

I have sourced that vim script. When I hit the key combination, I can see the message being displayed. Then when I go and change something in that script, for example, replace DEBUG with FOO and run :ReloadScript, nothing happens. No messages. And the function still prints the old message.

I have installed the script using NeoBundle maybe that has something to do with this?

Thanks.

symbolix avatar Jul 09 '15 23:07 symbolix