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

Work with vim-pandoc plugin? #9

Open
user202729 opened this issue Sep 4, 2021 · 2 comments
Open

Work with vim-pandoc plugin? #9

user202729 opened this issue Sep 4, 2021 · 2 comments

Comments

@user202729
Copy link

user202729 commented Sep 4, 2021

Some user use plugins such as https://github.com/vim-pandoc/vim-pandoc-syntax#standalone (especially because this plugin is for pandoc), and the ftdetect feature of this plugin may interact badly with the given plugin. (markdown / markdown.pandoc)

Suggestion: remove the ftdetect part entirely. (I think in the newest Vim version md files are automatically mapped to markdown by default)

@iamemhn
Copy link

iamemhn commented Jul 17, 2023

That's right. I did three things and now this plugin cooperates with vim-pandoc and supports more file extensions:

  • Removed the ftdetect directory altogether, since vim-pandoc does a more general job at detecting the file type.

  • I rewrote the BufWritePost to use a conditional based on the filetype, instead of relying on file extensions. This makes it more general because it can work with simple markdown files as detected by standard vim or other Markdown plugins, or with pandoc files as detected by vim-pandoc. I'm using

      autocmd BufWritePost * if &filetype == "pandoc" || &filetype == "markdown" | call s:CompileMd() | endif
    
  • Added a hard link so ftplugin/pandoc.vim and ftplugin/markdown.vim are the same file. That way the previewer works with either filetype, again making this plugin work nicely with standard vim, other markdown plugins, and vim-pandoc.

@iamemhn
Copy link

iamemhn commented Jul 17, 2023

I believe #12 should take care of this.

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