-
Notifications
You must be signed in to change notification settings - Fork 676
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
Add support for fuzzy tag search #27
Comments
I was about to post this as well... but thought that someone would implement it, since ctrlp now has support for user extensions (judging by commits) I already ditched Command-T :D, FuzzyFinder to be next |
Yup, I've made it very simple to add extensions to ctrlp. Everything you need to know is here. But I guess it's unlikely that someone will do this, so I'll give it a shot once I have some more free time. Thanks for the suggestion! |
Added along with another extension for quickfix. You can enable it with: let g:ctrlp_extensions = ['tag'] Start in tag mode with If you find any problem or see anything that can be improved, let me know. Thanks! |
I also use EazyTags, and I'd like to leave tag updating to it. Also I don't see any tags if EasyTags is enabled (Didn't thought this extensions will be ready so soon and so short :) ) Feel free to check my vim config for details: to install extensions run make in ~/.vim |
This problem also occurs with tags extension disabled. |
c3b316a should take care of the updatetime complaint from easytags. This tag extension only looks for tags files defined with the Vim's let &tags .= ','.vim_tmp.'/easytags' |
Yes the issue is solved, but I still don't see tags Yes tags file is included. But I've set easytags to create tags file for each filetype I edit. I suppose CtrlPTag should check tag file after each time it's invoked (since tags setting is dynamic) (EasyTags is managing last tags option (path to file)) |
Assuming that the |
When I try and launch the
|
Nope, F5 doesn't help |
Let know me know how a4b8d4c works? Thanks! |
Still nothing... I'll get home and check my config... perhaps I'm missing something... |
:set tags output:
(~/tmp is link to /tmp/.graudeejs) |
Do |
On Mon, 28 Nov 2011 10:42:27 -0800
Aldis Berjoza |
I was able to reproduce this by setting path_mode to 0. However, it should I'll investigate further and try to find a fix soon. On Tue, Nov 29, 2011 at 2:14 AM, Aldis Berjoza <
|
I disabled EasyTags (removed plugin) and manyally set tags path to /tmp/.graudeejs/.vim/easytags/vim with
and CtrlPTag works. Btw, I have suggestion: |
* Pass s:tagfiles and path of the current buffer to tag.vim to properly expand '.' in the 'tags' option. Continue #27.
Let me know how the new commit works. Thanks! As for filtering duplicates, the :tag command already kind of does this, it Kien On Tue, Nov 29, 2011 at 2:35 AM, Aldis Berjoza <
|
Yey, it works. Now one more thing:
For second, perhaps it would be good to enter tag name, and then search for file where this tag is. perhaps tag@file format (or should I make new Feature request?) |
That'll require some non-trivial changes in how ctrlp does the whole pattern matching. Sounds really cool though, so I'll definitely look into it. As for seaching tags in current buffer, it's much more complicated, and I think tagbar and taglist already do it and do it better, so I probably won't make this. @claytron: Can you let me know how it works for you now? Thanks! |
Pretty sweet stuff going on in here! :D |
I just came to work. I'll work with it for few hours, then I'll let you know... |
Ok, found a minor problem. When you work with multiple files, ctrlp caches tags for first file. I suggest doing that automatically when CtrlPTag is opened, because it will be annoying as hell to update tags every time I open ctrlp. Also that could prevent CtrlPTag from jumping to wrong line of code, if file was updated (I haven't tested, but I suppose it would jump to wrong line) I hit a bug..... CtrlPTag can't find tag... when I select any tag and hit Enter it opens Empty buffer saying: "CtrlP: Tag not found." |
Wow... this happens even if I delete tags file and EasyTags creates new (fresh) one |
Can you provide steps to reproduce the "Tag not found" error? For the caching, I'll use something other than just checking for filenames. |
For sake of environment differences I suggest you take my vim config
Wait 4-5 seconds for EasyTags to generate tags |
Good idea, I'll try that. My guess is that easytags changes the results returned by Anyway, thanks for your time! On Tue, Nov 29, 2011 at 2:42 PM, Aldis Berjoza <
|
* Save and restore &l:tags when creating a new buffer, workaround for easytags.vim changing the buffer's &l:tags and allow using <c-x> <c-t> <c-v> and <cr> to open file. * New caching method, remove the need for <F5>. * Continue #27.
It works after last commit Will do more testing... |
@kien I don't think it can handle the size of my tags file:
I can let it run for a while to see how long it takes to complete. But right now it isn't usable for that many tags. |
I see. Well, give me a couple of days I'll try adding persistent caching to On Tue, Nov 29, 2011 at 8:00 PM, Clayton Parker <
|
@kied..... CtrlPTag really needs to show tags of current file by default. I don't think it would be hard to implement (Need an idea on this?) |
Sure, I'm listening! On Tue, Nov 29, 2011 at 9:09 PM, Aldis Berjoza <
|
The result should probably be stored in other list. This would allow to implement quick switching to all tags mode and back to current buffers tags. I don't think it would be slow, but I'm VimL noob. Anyway, I think user will work with current buffers tags most of the time (also would be good to sort tags by weight according to filename path, similar to how file fuzzy searching is implemented now) |
Another bug: Currently when you search for tag it show all tags. Now if there are multiple tags with same name but in different files, CtrlPTag can jump to wrong file (even if you manually [with arrow keys] select which tag you want to jump to) |
* Change the opening commands to the tag-matchlist commands. * Stop using taglist() so we don't have to worry about &l:tags. * Persistent caching for tags. * Continue #27.
@claytron: How does it work for you now? In addition to adding persistent caching, I also remove @graudeejs: That could potentially lead to listing the wrong tags from the wrong file, and would be much slower than using ctags, for example. As for the problem with multiple tags with the same name, tag.vim now uses the tag-matchlist commands as a workaround. |
It is now showing list of tags and from where they are, and asks me to enter number of tag that I want to open. No good. |
It only does that if there's at least one other tag with the same name (there are 2 'index' in your case). This should be good enough for now, as using the filename to identify the tag isn't reliable. |
Why not? Most of time while I work (as Rails programmer) I'll have more >1 tags with same name |
For people who don't use easytags and have more than one tag file, the filenames can also be the same, as their locations are relative to the tags files. It's like this:
And the tags option: set tags+=./dir_a/tags,./dir_b/tags The listing would look like this:
So unless I'm missing something, there's no easy way out but using tag-matchlist. |
I see |
* Add a simple tag count finder. Continue #27.
* Discard all time consuming tasks when initializing tag.vim - #27.
It should be much faster now. I did a few tests with a tags file that has 200000 tags and it seemed to work reasonably well. There are probably a few ugly trade-offs, but at least it loads up in this extreme case. I also added a tag-count finder, with it you only get the matchlist prompt when the tags are actually identical. |
Closing this as it's gotten really long and the main issues have been resolved. Thanks everyone for the feedbacks! Lastly, just to clarify, you also get the matchlist prompt (see in @graudeejs' screenshot) with So what the tag-count finder does here is it helps switching to the |
The one feature that is keeping me on FuzzyFinder at the moment is the
:FufTag
mode. Would it be possible to add a fuzzy tag search to ctrlp?The text was updated successfully, but these errors were encountered: