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

Tags it returns empty results #22

Closed
mikezaby opened this issue Oct 5, 2015 · 20 comments
Closed

Tags it returns empty results #22

mikezaby opened this issue Oct 5, 2015 · 20 comments
Labels

Comments

@mikezaby
Copy link

mikezaby commented Oct 5, 2015

When i run Tags even if i have compiled the tags manualy or let the fzf create it, i have no results.

I am using vim in debian testing

VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Aug 17 2015 03:37:50)
Included patches: 1-826
@junegunn
Copy link
Owner

junegunn commented Oct 5, 2015

What is the output of :echo tagfiles()?

@mikezaby
Copy link
Author

mikezaby commented Oct 6, 2015

The output is ['tags']
Also the tag mechanism is working with the default vim behavior like ctrl+}

@junegunn
Copy link
Owner

junegunn commented Oct 6, 2015

Maybe the file is empty. Can you open it and see if it contains the tags you want?

@mikezaby
Copy link
Author

mikezaby commented Oct 6, 2015

I think the tags file is ok.
I create a dummy project for this purpose: https://github.com/mikezaby/fzf-test.
The tag file: https://raw.githubusercontent.com/mikezaby/fzf-test/master/tags

For example: I am in app/controllers/articles_controller.rb, if i press ctrl+} in line 7 Article, it opens correctly the app/model/article.rb, but the :Tags is empty.

@junegunn
Copy link
Owner

junegunn commented Oct 6, 2015

Alright, can you check if this command works? It's what Tags command does internally.

perl -ne 'unless (/^!/) { s/^(.*?)\t(.*?)\t/\x1b[33m\1\x1b[m\t\x1b[34m\2\x1b[m\t/; print }' tags

@mikezaby
Copy link
Author

mikezaby commented Oct 6, 2015

It seems to work, a small sample of the output

zip /home/miza/.rvm/gems/ruby-2.2.0/gems/sass-3.4.18/lib/sass/script/functions.rb   /^    def zip(*lists)$/;"   f
zone    /home/miza/.rvm/gems/ruby-2.2.0/gems/activesupport-4.2.4/lib/active_support/core_ext/time/zones.rb  /^    def zone$/;"  f   class:Time
zone    /home/miza/.rvm/gems/ruby-2.2.0/gems/activesupport-4.2.4/lib/active_support/time_with_zone.rb   /^    def zone$/;"  f   class:ActiveSupport.TimeWithZone
zone=   /home/miza/.rvm/gems/ruby-2.2.0/gems/activesupport-4.2.4/lib/active_support/core_ext/time/zones.rb  /^    def zone=(time_zone)$/;"  f   class:Time
zone_identifiers    /home/miza/.rvm/gems/ruby-2.2.0/gems/tzinfo-1.2.2/lib/tzinfo/country.rb /^    def zone_identifiers$/;"  f   class:TZInfo.Country
zone_identifiers    /home/miza/.rvm/gems/ruby-2.2.0/gems/tzinfo-1.2.2/lib/tzinfo/country_info.rb    /^    def zone_identifiers$/;"  f   class:TZInfo.CountryInfo
zone_identifiers    /home/miza/.rvm/gems/ruby-2.2.0/gems/tzinfo-1.2.2/lib/tzinfo/ruby_country_info.rb   /^    def zone_identifiers$/;"  f   class:TZInfo.RubyCountryInfo
zone_identifiers    /home/miza/.rvm/gems/ruby-2.2.0/gems/tzinfo-1.2.2/lib/tzinfo/zoneinfo_country_info.rb   /^    def zone_identifiers$/;"  f   class:TZInfo.ZoneinfoCountryInfo
zone_info   /home/miza/.rvm/gems/ruby-2.2.0/gems/tzinfo-1.2.2/lib/tzinfo/country.rb /^    def zone_info$/;" f   class:TZInfo.Country
zones   /home/miza/.rvm/gems/ruby-2.2.0/gems/tzinfo-1.2.2/lib/tzinfo/country.rb /^    def zones$/;" f   class:TZInfo.Country
zones   /home/miza/.rvm/gems/ruby-2.2.0/gems/tzinfo-1.2.2/lib/tzinfo/country_info.rb    /^    def zones$/;" f   class:TZInfo.CountryInfo
zones   /home/miza/.rvm/gems/ruby-2.2.0/gems/tzinfo-1.2.2/lib/tzinfo/ruby_country_info.rb   /^    def zones$/;" f   class:TZInfo.RubyCountryInfo
zones   /home/miza/.rvm/gems/ruby-2.2.0/gems/tzinfo-1.2.2/lib/tzinfo/zoneinfo_country_info.rb   /^    def zones$/;" f   class:TZInfo.ZoneinfoCountryInfo
zones_map   /home/miza/.rvm/gems/ruby-2.2.0/gems/activesupport-4.2.4/lib/active_support/values/time_zone.rb /^      def zones_map #:nodoc:$/;"  f   class:ActiveSupport.TimeZone
|   /home/miza/.rvm/gems/ruby-2.2.0/gems/json-1.8.3/lib/json/generic_object.rb  /^    def |(other)$/;"  f   class:JSON

@mikezaby
Copy link
Author

mikezaby commented Oct 6, 2015

I tried also grep -v '^!' tags that works

@junegunn
Copy link
Owner

junegunn commented Oct 6, 2015

Hmm, which version of fzf do you have? fzf --version

@mikezaby
Copy link
Author

mikezaby commented Oct 6, 2015

I did a plug update now, and still has the same problem.
fzf version: '0.10.7'
Now if i run :Tags and after quit the vim, i saw this error

Unknown regexp modifier "/e" at -e line 1, at end of line
Unknown regexp modifier "/v" at -e line 1, at end of line
syntax error at -e line 1, near "/) "
syntax error at -e line 1, near ";}"
Execution of -e aborted due to compilation errors.

@junegunn
Copy link
Owner

junegunn commented Oct 6, 2015

Ah, I just realized that I see the same error when I run the bang-version, :Tags!. Works fine with tmux though. I'll see what I can do.

@junegunn junegunn added the bug label Oct 6, 2015
@junegunn
Copy link
Owner

junegunn commented Oct 6, 2015

I think it should be fixed now. Please update and try again.

@mikezaby
Copy link
Author

mikezaby commented Oct 6, 2015

Yes, it works now. Thanks

@micalexander
Copy link

micalexander commented Jun 28, 2017

  • Category
    • Question
    • Bug
    • Suggestion
  • OS
    • Linux
    • macOS
    • Windows
    • Etc.
  • Vim
    • Vim
    • Neovim

This is also the case for me. :Tags command returns empty results. There is a tags file generated in the root already but I get nothing.

0/0
Tags>

I am currently running Neovim on Alpine Linux with Python3.

I do not have Perl so the following command is not available in the neovim version I have. I did not think I needed Pearl to run neovim.

perl -ne 'unless (/^!/) { s/^(.?)\t(.?)\t/\x1b[33m\1\x1b[m\t\x1b[34m\2\x1b[m\t/; print }' tags

When I run :Files I do get results but it is only when I have FZF_DEFAULT_COMMAND set. I was under the impression that it would give me results even if that Environment variable was not set.

And yes I can reproduce the problem with

vim -Nu <(curl https://gist.githubusercontent.com/junegunn/6936bf79fedd3a079aeb1dd2f3c81ef5/raw)

@junegunn
Copy link
Owner

@micalexander

Neovim does not require perl, but Tags command of this plugin requires perl. You can install perl, or send me a pull request that removes perl dependency.

When I run :Files I do get results but it is only when I have FZF_DEFAULT_COMMAND set. I was under the impression that it would give me results even if that Environment variable was not set.

It should. You might want to test fzf on your terminal first. Also check if the default command runs fine on it. https://github.com/junegunn/fzf/blob/master/src/constants.go#L55

@micalexander
Copy link

@junegunn same thing in the terminal. Running fzf without the FZF_DEFAULT_COMMAND variable set does nothing. Running

find -L . -mindepth 1 \( -path '*/\.*' -o -fstype 'sysfs' -o -fstype 'devfs' -o -fstype 'devtmpfs' -o -fstype 'proc' \) -prune -o -type f -print -o -type l -print 2> /dev/null | cut -b3-

Does nothing.

@junegunn
Copy link
Owner

It's a valid command. You'll have to figure out why it doesn't run on your system.

@micalexander
Copy link

So thanks for your help. The :Tags command was, of course, perl needing to be installed. The issue with the FZF_DEFAULT_COMMAND variable needing to be set explicitly for fzf to work (in the command line and the :Files command in vim), was that alpine linux's version of find is limited so I needed to install the gnu version of find in order for it to work.

apk add --update-cache findutils

I appreciate your work and look forward to using fzf more, with and without vim.

@junegunn
Copy link
Owner

Thanks, I'll see if I can make fzf print error messages in those cases.

junegunn added a commit to junegunn/fzf that referenced this issue Jun 30, 2017
@junegunn
Copy link
Owner

See:

@micalexander
Copy link

@junegunn Boss! Would be nice to get it added to the readme. But thanks just the same.

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

3 participants