0

The plugin Taglist is showing tags perfectly for my python but not for my markdown files.

There is a MCVE on github.

I have two files. test1.py is:

def one():
    print("one")

def two():
    print("two")

and test2.md is:

# One

The Quick brown fox

# Two

Jumped over the lazy dog

I use the following .ctags file:

--langdef=markdown
--langmap=markdown:.md
--regex-markdown=/^#[ \t](.*$)/\1/f,heading,headings/

The command

ctags test1.py test2.md

creates a tag file, with all four tags in:

!_TAG_FILE_FORMAT       2       /extended format; --format=1 will not append ;" to lines/
!_TAG_FILE_SORTED       1       /0=unsorted, 1=sorted, 2=foldcase/
!_TAG_PROGRAM_AUTHOR    Darren Hiebert  /dhiebert@users.sourceforge.net/
!_TAG_PROGRAM_NAME      Exuberant Ctags //
!_TAG_PROGRAM_URL       http://ctags.sourceforge.net    /official site/
!_TAG_PROGRAM_VERSION   5.8     //
One     test2.md        /^# One $/;"    f
Two     test2.md        /^# Two$/;"     f
one     test1.py        /^def one(): $/;"       f
two     test1.py        /^def two(): $/;"       f 

but when I open the editor. I have:

enter image description here

why are my markdown tags not showing?

4
  • This may be better asked of the plugin maintainers
    – D. Ben Knoble
    Jun 29 at 11:15
  • I'm open to feedback on the question - I thought I did everything right and still got downvoted?
    – Joe
    Jun 30 at 20:49
  • 1
    I didn't downvote, so I can't answer definitively. Questions about configuring plugins correctly are a tough nut for this community: some people don't mind, and some people seem really against them. (I've not seen anyone love them.) All in all, I thought the Q was pretty well put together, so have a neutralizing upvote. Next time, maybe poke around in the plugin's documentation or community, too (github.com/yegappan/taglist/blob/master/doc/taglist.txt#L1204). And a link to the correct plugin is helpful.
    – D. Ben Knoble
    Jun 30 at 21:40
  • all useful. thank you.
    – Joe
    Jul 1 at 5:42
1

You can try adding the following line to your .vimrc file:

let tlist_markdown_settings = 'markdown;f:Heading'

Another approach is to use Universal Ctags (https://github.com/universal-ctags/ctags) instead of exuberant ctags. Universal Ctags natively supports tags for markdown files.

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.