Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I do not think the plugin is working. #1

Open
symbolix opened this issue Jul 5, 2015 · 2 comments
Open

I do not think the plugin is working. #1

symbolix opened this issue Jul 5, 2015 · 2 comments

Comments

@symbolix
Copy link

symbolix commented Jul 5, 2015

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?

@xolox
Copy link
Owner

xolox commented Jul 8, 2015

  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?

@symbolix
Copy link
Author

symbolix commented Jul 9, 2015

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 MyHook :execute 'HookMyFunc ' . g:my_var_a . ' ' . g:my_var_b``

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants