Open alexzanderr opened 3 years ago
That sounds like it could be a good idea. I don't know that we'd be able to do any kind of a popup type window or auto-fill based on a partial search pattern, but basic searching could be possible.
One thing to note on this, If the tagbar status line is not being used, and the tagbar window has never been opened for a file, then that file has not yet been examined. So if this is implemented it will have to take that into account to force an update on the file before searching for any tags.
Would you expect the syntax to be something like this?
:TagbarSearch <search-pattern>
And would you want to leave the tagbar window closed if it was closed? Or would you want to have it open the tagbar window and jump to the tag in the tagbar window? Or are you expecting it to jump to the tag in the file window?
this would be good
:TagbarSearch <search-pattern>
write :TagbarSearch
, then write pattern
, press enter
. if pattern is found in current file only (because the search consists looking in current file only, not globally) then jump in current file to the tag's location.
a function such as TagbarSearchWithLiveSearch
that could be binded to a keymap
.
when i press for example <C-F>
this shoul call the function and then:
and then look like this:
but just for tags that appear in the tagbar (or the current file)
the principle is this:
<C-F>
up
/down
) between live resultsi would like to see something like this and like vs code's outline search. would be great if you could implement both options.
i know that i have big expectations.
Honestly this is done using fzf.vim, generate the tags file and use :Tags under the project and search for your function. I use it currently. Also, is there a Telegram group for connecting with others to explore more of tagbar's features?
@alexzanderr The process you are describing doesn't sound quite like a match for tagbar. Tagbar is using the output of ctags to parse known tags in a file, but not the spots where those tags may be used. In you example, doing a search for https://github
and showing all entries that match that in a file doesn't really sound like it would be useful for a tag. There would likely only ever be a single entry of a tag.
Now for partial matches, yes I could see how you could have multiple tags partially matching the search pattern. However this sounds a lot like just using the normal vim search in the tagbar window itself. The process you describe could easily be done in the tagbar window itself.
:TagbarOpen f
to open the tagbar window and switch focus to that window/<search-pattern>
to search the tags in the tagbar windowup
/down
arrow keys to navigate through the tags to find the one you want<Enter>
to jump to that tagMuch of this can be done using shortcuts as well or configuration options to help control it. There is a g:tagbar_autoclose
configuration for example which can close the tagbar window when you jump to a tag. There is also the g:tagbar_sort
option to change how the tags are sorted between name and file order. You could also map the :TagbarOpen f
to a keymap in vim as well, so it really sounds like this functionality is exactly what tagbar is capable of with a little modification of your key mappings and config in your .vimrc
.
@daedroza I'm not aware of any Telegram group for tagbar's features. I've only ever been involved with it here on github.
i dont know if there is a function for that. i read the docs, i didnt find any related content.
im requesting a feature.
please add a function callable from command-line called
:TagBarFuzzyFindTag
function behaviour:search
for a tag in current opened file<enter>
is pressed, it shouldjump
in the file at thattag's location
close
just like vs code![image](https://user-images.githubusercontent.com/54772464/121485843-435a2700-c9d9-11eb-87d9-35c9ac3b80bf.png)
Ctrl+P
+@
outline search:it would be great if it would have a beautiful animation like this one.
OR
tell me how to make my own fuzzy tag finder
i know that there are already functions related to this such as
:tagbarshowtag
and:tagbarcurrenttag
, but i cant combine them in order to search for a tag and if found then jump to it, or i dont know how to.thanks in advance.