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

Nothing is shown in the tagbar window in md file #19

Open
Palvehelmed opened this issue Dec 8, 2020 · 3 comments
Open

Nothing is shown in the tagbar window in md file #19

Palvehelmed opened this issue Dec 8, 2020 · 3 comments

Comments

@Palvehelmed
Copy link

Palvehelmed commented Dec 8, 2020

Hi, I'm trying to find out why it suddenly not working for any .md file
when I first installed it, it can work normally, however it can not show anything now. I do configure .vimrc like README page.

I use macvim and i installed these related plugs.

Plug 'majutsushi/tagbar'
Plug 'jszakmeister/markdown2ctags'
Plug 'xolox/vim-misc'
Plug 'xolox/vim-easytags'

I tried markdown2ctags -f - test.md. and got the following information.

!_TAG_FILE_ENCODING	utf-8	//
!_TAG_FILE_FORMAT	2	//
!_TAG_FILE_SORTED	1	//
Dec 7, 2020, 1:55 PM	/Users/ryan/Desktop/test.md	/^#### Dec 7, 2020, 1:55 PM$/;"	s	line:10	section:test
Dec 7, 2020, kkk12:35 AM	/Users/ryan/Desktop/test.md	/^#### Dec 7, 2020, kkk12:35 AM$/;"	s	line:2	section:test
test	/Users/ryan/Desktop/test.md	/^### test$/;"	s	line:1

I really can't realize what is going wrong

@jszakmeister
Copy link
Owner

Hi, I'm trying to find out why it suddenly not working for any .md file
when I first installed it, it can work normally, however it can not show anything now. I do configure .vimrc like README page.

Can you show me your tagbar configuration?

Plug 'jszakmeister/markdown2ctags'

markdown2ctags is not a vim plugin. It's best to pip install it and make sure it's on your path, and configure tagbar to use the pip install'd version.

I tried markdown2ctags -f - test.md. and got the following information.

!_TAG_FILE_ENCODING	utf-8	//
!_TAG_FILE_FORMAT	2	//
!_TAG_FILE_SORTED	1	//
Dec 7, 2020, 1:55 PM	/Users/ryan/Desktop/test.md	/^#### Dec 7, 2020, 1:55 PM$/;"	s	line:10	section:test
Dec 7, 2020, kkk12:35 AM	/Users/ryan/Desktop/test.md	/^#### Dec 7, 2020, kkk12:35 AM$/;"	s	line:2	section:test
test	/Users/ryan/Desktop/test.md	/^### test$/;"	s	line:1

So this says markdown2ctags is working. What system are you on? My guess is if you're calling the script directly via the plugin folder, python might not be available (a lot of distros having been heading towards one with a number--python2 or python3). I haven't switched my script yet because I work with some older systems where it'd be a nuisance to tweak things, but perhaps it's time if you're running into this problem.

The other issue might be a configuration issue. I haven't really changed anything there, except to get a bit smarter about handling unicode issue. But the above works, so the tool is fine. It's likely configuration or how it's being invoked.

@Palvehelmed
Copy link
Author

Hi there, I appreciate to your reply

I have tried to restore my whole system and it doesn't work either.
My system is Mac OS 11, python version is Python 2.7.16,

Should I try to use pip install it next step? I am looking forward to your reply

my tagbar configeration likes that

let g:tagbar_type_markdown = {
    \ 'ctagstype': 'markdown',
    \ 'ctagsbin' : '~/.vim/plugged/markdown2ctags/markdown2ctags.py',
    \ 'ctagsargs' : '-f - --sort=yes --sro=»',
    \ 'kinds' : [
        \ 's:sections',
        \ 'i:images'
    \ ],
    \ 'sro' : '»',
    \ 'kind2scope' : {
        \ 's' : 'section',
    \ },
    \ 'sort': 0,
\ }

@jszakmeister
Copy link
Owner

jszakmeister commented Dec 11, 2020

Can you try with your test file using: ~/.vim/plugged/markdown2ctags/markdown2ctags.py -f - --sort=yes --sro=» test.md? The configuration looks okay. What file are you testing against? Can you post one via a private gist on https://gist.github.com/ and post the link here? Perhaps there's something in the file you're testing that is causing a problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants