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

how to make a new plugin recognise an extension? #1188

Open
ghostwheel opened this issue Sep 21, 2018 · 0 comments
Open

how to make a new plugin recognise an extension? #1188

ghostwheel opened this issue Sep 21, 2018 · 0 comments

Comments

@ghostwheel
Copy link

I don't think this is the right place to ask this question.
So maybe the first question is what is the right place to ask this question?

I'm trying to use literate (lit) with micro. Everything works great!
I'm trying to use an alternate version of literate, which I got form here: https://github.com/robertkovacs/Literate

This version uses regular markdown (.md) files for the literate program, instead of the .lit files.
I'm trying to get micro to use the .lit mode for .md files.

First, I edited literate.lua, and changed the lines recognising code section:

syntaxFile = syntaxFile .. "        start: \"```.*$\"\n"
syntaxFile = syntaxFile .. "        end: \"```$\"\n"

This worked. Now if I rename the file from file.md to file.lit, it enters the right mode, and code lines are syntax highlighted correctly. Now I also wanted to have the literate mode activated for regular .md files.
How do I do that?

  1. I tried to edit literate.lua, replacing all .lit with .md, or .lit.md or .lid_md. Nothing worked. What is the right way to add a mode to handle a new extension?
  2. Is there a way to switch a buffer to a different mode? So, I would load an .md file and manually switch to literate mode?

Thanks!

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

1 participant