10

I'm using the vimwiki plugin and trying to figure out tagging with vimwiki-syntax-tags.

I can add a tag :tag-example: to a vimwiki .wiki file.

I can search :VimwikiSearchTags tag-example and it will find the tag properly.

If there are two instances of this tag, the search returns the first instance and displays (1 of 2): :tag-example:

Does anyone know how to go to the next tag instance found by the search?

Any other suggestions related to tagging / vimwiki would be appreciated as well.

Thanks

10

The results from :VimwikiSearchTags are populated in the location-list window, so you can navigate using :lnext and :lprevious, or you can check all the results using :lopen.

To be honest, despite I have been using Vimwiki for several years, I didn't know about the tags. Maybe it is because my wikis are not that large (~2 MB at most), but I find it easier to simple :grep (or :Ack) everything, which is quite fast, instead of writing the tags in advance.

1
  • Be warned that the first time using VimwikiSearchTags may take a long while. I have been using Vimwiki since 2014, and have just discovered the tag syntax :) Sorting through my 2K+ notes should take a good number of minutes.
    – llinfeng
    Jan 14 '19 at 16:07
0

Just a quick test on :VimwikiSearchTags vs Ripgrep

FTW - I'm going to stick with https://github.com/jremmen/vim-ripgrep

:Rg -i :tag-example
1
  • 1
    Tony, I've taken the liberty of editing your post with code-formatting and a slight capitalization. Your post would really benefit, however, from more details explaining what's going on
    – D. Ben Knoble
    Jan 11 '20 at 16:27
0

After searching with :VimwikiSearchTags, use :lopen. This will open a Vim 'split'.

After selecting the note you want in the split, you can close the split created with :lopen by pressing ctrl+o.

If you decide to leave the split open so you can move between notes, you can navigate splits using ctrl+w then h, j, k, or l

4
  • This is pretty well covered in the accepted answer...
    – D. Ben Knoble
    Apr 17 '20 at 18:11
  • I actually learned about :lopen from the accepted answer about a year ago. At the time, it took me about an hour to find that the weird thing it did to my screen was called a split. I remember looking at the other answers for a clue about what type of object :lopen is and how to work with it. If my 20 second post saves at least one person an hour of searching, I'll consider that a victory Apr 18 '20 at 8:29
  • 1
    fair enough... perhaps 1-year-ago you would be glad to learn about the :help command (:help :lopen, for example)
    – D. Ben Knoble
    Apr 18 '20 at 12:55
  • Your point is well taken, and I agree - man pages are wonderful things, and folks should be encouraged to use them. In fact, I did know to use :help :lopen at the time - as a novice, the results were overwhelming. Apr 18 '20 at 22:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.