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

For some reason it is not working #107

Closed
jimzenn opened this issue Jun 29, 2016 · 12 comments
Closed

For some reason it is not working #107

jimzenn opened this issue Jun 29, 2016 · 12 comments
Labels

Comments

@jimzenn
Copy link

jimzenn commented Jun 29, 2016

I install the plugin with vim-plug. It worked before, but somehow it does not work any more. Any one with me?

@muff1nman
Copy link
Collaborator

Can you provide a bit more detail? What platform? Whats not working? Also it would be helpful to put let g:templates_debug = 1 into your vimrc and then send us the output of :messages

@jimzenn
Copy link
Author

jimzenn commented Jul 14, 2016

There seem to be no messages except

Messages Maintainer: Bram Moolenaar <[email protected]>

Which is not very useful.

Sorry for providing such limited information, but there is no hint or error message.

I'll try to find out what causes this problem. Thank you for your response!

@muff1nman
Copy link
Collaborator

Also, you could try:

vim -V9vim-template.log test.txt

and send us that output.

@jimzenn
Copy link
Author

jimzenn commented Jul 14, 2016

Now I get the log.

Executing `find -L '/Users/Jim/Code/test/' -maxdepth 1 -type f -name '.vim-template:*'`
Executing `find -L '/Users/Jim/Code/' -maxdepth 1 -type f -name '.vim-template:*'`
Executing `find -L '/Users/Jim/' -maxdepth 1 -type f -name '.vim-template:*'`
Executing `find -L '/Users/' -maxdepth 1 -type f -name '.vim-template:*'`
Executing `find -L '/' -maxdepth 1 -type f -name '.vim-template:*'`
Executing `find -L '/Users/Jim/.config/haskell-vim-now/.vim/bundle/vim-template/templates/' -maxdepth 1 -type f -name '=vim-template=*'`
No template found

screen shot 2016-07-14 at 08 40 08

As you see it can not find the templates, but I'm sure the templates are there in the last directory.

screen shot 2016-07-14 at 08 41 49

@muff1nman
Copy link
Collaborator

Okay I see what the issue is. It looks like the builtin templates are using the g:templates_global_name_prefix variable that was changed to .vim-template: in your config. This is actually right in line with the discussion in #106. But you mentioned this worked at some point with your config?

Regardless I definitely think this is something we are going to look to change.

@jimzenn
Copy link
Author

jimzenn commented Jul 16, 2016

I never changed g:templates_global_name_prefix to .vim-template: by myself, and I searched my .vimrc file, I don't find this variable.

Plus, it is finding =template= in /Users/Jim/.config/haskell-vim-now/.vim/bundle/vim-template/templates/.

Am I understanding it correctly? How should I fix this?

@jimzenn
Copy link
Author

jimzenn commented Aug 4, 2016

Could you help me about this?

@dbellavista
Copy link

@Jim-Zenn I am experiencing this problem using Mac OS since forever.
I think the find command (in addition to be terribly slow) isn't properly working. So I just stick with revision d930746 which works just fine.

@aperezdc
Copy link
Owner

@dbellavista Wow, that is quite an old revision... Thing is, we have this in the code:

    " Use find if possible as it will also get hidden files on nix systems. Use
    " builtin glob as a fallback
    if executable("find") && !has("win32") && !has("win64")

...so maybe we can also add && !g:template_do_not_use_find as one additional condition there.

I am still puzzled about this usage of find not working in Mac OS (yes, I'll keep using that spelling), even when according to the manual page the flags being used have the same meaning as in GNU/Linux. Ultimately it would be great to figure out what's going on, but I think we can have an option as workaround in the meantime.

@dbellavista
Copy link

dbellavista commented Oct 19, 2016

@aperezdc Oh my... I actually just redo the same debug I've done 10 month ago ( #92 ) I can confirm that using Fish Shell (the bastard) the vim command

:glob("`find`")

is not executed correctly since fish has deprecated backtick expansion. There is nothing wrong with macOS (right, we should use the right spelling :) )

Sooo... the solution is to set the shell to /bin/bash or via environemnt or by inserting set shell=/bin/bash on the top of your .vimrc.

@Jim-Zenn is there a change you are using some esoteric shell instead of the standard bash/zsh ?

@jimzenn
Copy link
Author

jimzenn commented Oct 19, 2016

I almost forgot this issue already... I don't know since when this plug-in start to work again. I didn't remember what I did.

Just now, I tested this plugin again under both fish and zsh. It works fine in both shell even without set shell=/bin/bash.

@aperezdc
Copy link
Owner

@dbellavista @Jim-Zenn Thanks for confirming that the plugin is now working for you. Probably we could add a FAQ section to the documentation, but for now I'll close this issue provided that the issue is no more.

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

4 participants