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

Perl-Support: Bundle installation #22

Closed
dracorp opened this issue Apr 26, 2015 · 3 comments
Closed

Perl-Support: Bundle installation #22

dracorp opened this issue Apr 26, 2015 · 3 comments
Labels

Comments

@dracorp
Copy link

dracorp commented Apr 26, 2015

Hello
I've got installed perl-support by Vundle in ~/.vim/bundle/perl-support.vim. I've added to the ~/.vim/bundle/perl-support.vim/plugin/perl-support.vim:

  " ==========  Linux/Unix  ======================================================
    "
    let g:Perl_PluginDir = expand("<sfile>:p:h:h")
    "
    if match( expand("<sfile>"), resolve( expand("$HOME") ) ) == 0
        " USER INSTALLATION ASSUMED
        if match( expand("<sfile>"), g:VIMFILESDIR.'bundle' ) == 0
      " BUNDLE INSTALLATION ASSUMED
      let g:Perl_Installation               = 'bundle'
      let s:Perl_LocalTemplateFile  = g:VIMFILESDIR.'/perl-support/templates/Templates'
      let s:Perl_ToolboxDir              += [ g:Perl_PluginDir.'/autoload/mmtoolbox/' ]
    else
      let g:Perl_Installation               = 'local'
      let s:Perl_LocalTemplateFile  = g:Perl_PluginDir.'/perl-support/templates/Templates'
      let s:Perl_ToolboxDir              += [ g:Perl_PluginDir.'/autoload/mmtoolbox/' ]
    endif
    else
        " SYSTEM WIDE INSTALLATION

and currently it works with my templates from ~/.vim/perl-support/templates.
Could you check it out and possibly put in the next release?

@WolfgangMehner
Copy link
Owner

Hello,
I need to clarify a few things before I move on:

So you have the Perl-Plugin installed here:
~/.vim/bundle/perl-support.vim/plugin/perl-support.vim
Which means you also should have template here:
~/.vim/bundle/perl-support.vim/perl-support/templates/...
You however want to use templates outside the directory maintained by bundle in
~/.vim/perl-support/templates/...

Is this correct?

You can use the configuration variable g:Perl_LocalTemplateFile to achieve that.
Or you can use the new features of Perl-Support (not available on vim.org, but in the version on GitHub). Have a look here (section "Installation"):
https://github.com/WolfgangMehner/vim-plugins/blob/master/perl-support/README.md
If you want to configure the stock templates rather than using your completely own library, you can use the new configuration via g:Perl_CustomTemplateFile. This is also available through the template setup wizard (menu entry Perl -> Snippets -> template setup wizard or map \ntw inside a Perl buffer).

Does this help you?

To be completely honest, I hesitate to change the code in the proposed way, because it would mean additional effort to setup the plug-in, namely to copy the templates to an additional location. Or am I missing something?

@dracorp
Copy link
Author

dracorp commented Apr 28, 2015

Hello
I think it will be correct.

You however want to use templates outside the directory maintained by bundle in

Yes, because I've got redefined several templates and I don't want to overwrite them when upgrading.
But you can propose better location.

You can use the configuration variable g:Perl_LocalTemplateFile to achieve that.

I thought that a variable with s: is different from g: but I was wrong ( I have used in my script variables with the same name but different namespace, eg. l:param and g:param). This may will be enough? I will check it when I come back to home.

@dracorp
Copy link
Author

dracorp commented Apr 28, 2015

Hi
I think that the solution with the variable will be enough. And I will wait for the new features in coming release.

@WolfgangMehner WolfgangMehner changed the title Perl-support: bundle installation Perl-Support: Bundle installation Nov 26, 2015
@dracorp dracorp closed this as completed Apr 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants