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

Problem with expanding wildcards. #92

Closed
straywarrior opened this issue Dec 1, 2015 · 11 comments
Closed

Problem with expanding wildcards. #92

straywarrior opened this issue Dec 1, 2015 · 11 comments
Assignees
Labels

Comments

@straywarrior
Copy link

I installed vim-template on both OS X and Ubuntu and my Vim version is 7.4.
However, Vim cannot find the template files.
I find that the command "find -L ..." cannot be executed correctly in Vim:
2015-12-01 22 25 57
But this command is working well in my shell, so it might be Vim's problem.

So, I modify the templates.vim to disable the use of "find" and now it works temporarily.
Is there something wrong with my Vim? I think there should be another way to solve this problem.

Thank you.

@aperezdc
Copy link
Owner

aperezdc commented Dec 1, 2015

In you screenshot it seems that you are trying to use Vim's :find (an Ex command), which does not have any to do with the invocation of find program from the system. That being said, I do not know why the plugin is not behaving correctly for you. Would you mind executing the following from Vim and writing back the result?:

:echo glob("`find -L '/Users/straywarrior/Documents/Developers/practice/network_programming/' -maxdepth 1 -type f -name '.vim-template:*'`")

@aperezdc aperezdc self-assigned this Dec 1, 2015
@straywarrior
Copy link
Author

Thank you.
I execute the ":echo glob(...)" in Vim but there's nothing printed...
I'm sure there are sample templates in ~/.vim/bundle/vim-template/templates/. I try to execute something like this in Vim but there is no result returned either. (The results in Ubuntu and OS X have no difference.)

:echo glob("`find -L '/home/fzt/.vim/bundle/vim-template/templates/' -maxdepth 1 -type f -name '=template=*'`")

@muff1nman
Copy link
Collaborator

Hmm. I'll try to get a hold of a macbook in the next couple days to see if I can reproduce.

@aperezdc
Copy link
Owner

@muff1nman: that would be awesome, I don't have an easy way of getting access to a MacOS X machine right now and I cannot investigate this further. Thanks a lot for offering to look into the issue :)

@muff1nman
Copy link
Collaborator

vim-template seems to work fine on a near default install of Mac OSX - I installed the developer tools to use git. Are you also having this issue with Ubuntu? Can you please add let g:templates_debug=1 to your .vimrc and then post the results of editing a file with logging enabled? e.g. vim -V9vim-template.log test.txt. What variables do you have set in your vimrc?

@straywarrior
Copy link
Author

I meet the problem both in Ubuntu and OS X.
But I just found something that may help. I added a set to vimrc:

set shell=/bin/bash

And then my vim-template works well.
I usually use fish shell and I know there are some differences between fish and bash. However, the command below can be executed correctly in fish.

find -L '/home/fzt/.vim/bundle/vim-template/templates/' -maxdepth 1 -type f -name '=template=*'

So I don't know the exact reason why vim-template cannot work without setting shell to bash.

Thank you all.

@aperezdc
Copy link
Owner

@straywarrior: That is very interesting, but I have installed fish in my machine, and I cannot reproduce the issue by adding this in my ~/.vimrc:

set shell=/bin/fish

but I cannot reproduce the issue either. I have also tried running Vim from inside fish and overwriting the SHELL environment variable, like this:

hikary ~ % fish  # Inside Zsh, this starts Fish
aperez@hikari ~> export SHELL=/bin/fish  # Inside Fish, set variable
aperez@hikari ~> vim foo.c  # Still inside Fish, try to create a new file with Vim

but still I cannot reproduce the issue.

Here I have Fish version 2.2.0 with its default configuration. Which version of fish are you using? Do you have changed any options which may affect shell expansion and/or globbing?

@dbellavista
Copy link

I have the same problem with fish. And I can reproduce on Mac osx (default shell fish)

daniele ~> bash # inside fish, start bash
bash$ export SHELL=/bin/bash
bash$ vim

Executing :echo glob("find . -print -maxdepth 1") shows the file list.

PS: I have not hardcoded the vim shell value.

@aperezdc
Copy link
Owner

@dbellavista @straywarrior Can any of you confirm that you got the plug-in working when using Fish as well? Or is the bug still there for you?

@dbellavista
Copy link

@aperezdc works for me with fish shell. Ty

@aperezdc
Copy link
Owner

Thanks for the confirmation @dbellavista! Let's close this issue now — it can be reopened if needed later on.

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