michaelb/sniprun

SnipRun is not working on markdown .md files on MacOS

jesse2point0 opened this issue · 2 comments

Describe the bug
SnipRun is not working on .md files on MacOS

To Reproduce

  1. Create test.md
  2. Populate with the following code
# Test Python
This is a code snippet

```python
abc = "abc"
print(abc)
```
  1. Run :SnipRun
  2. Output is Filetype not officially supported, nor configured for the Generic interpreter

Expected behavior
If i create the same snippet of code in a .py file it works fine.

I have tried with this in my set.lua:

interpreter_options = {
    GFM_original = {
        use_on_filetypes = {"markdown", "md", "markdown.pandoc", "rstudio" }
    }
}

as well as:

interpreter_options = {
    GFM_original = {  }
}

Screenshots
image

I also tried the healthcheck with no success.

SnipRun: health#SnipRun#check
========================================================================
  - ERROR: Failed to run healthcheck for "SnipRun" plugin. Exception:
    function health#check, line 20
    Vim(eval):E117: Unknown function: health#SnipRun#check

Environment:

  • Neovim version NVIM v0.8.2
    • Just upgraded to NVIM v0.9.4
  • M1 Mac, 13.5 (22G74)
  • Packer config: use { 'michaelb/sniprun', run = 'sh ./install.sh'} and PackerSync successful

run = 'sh ./install.sh'

On ARM macOS ???? (Not "sh ./install.sh 1" ??) I'm flabbergasted it even works

As for your actual issue, neovim usually associate a 'filetype' to files. filetype is not necessary taken from the file extension.

Can you run :set ft? to determine which is the filetype of your buffer ?

Alternatively, :set ft=markdown should make it one of the default filetype for the wanted sniprun interpreter.

It might be necessary to add the filetype (if it's a strange one and you don't want to change it) to the interpreter's options like you have already done (but is your 'set.lua' actually used ?)

If you're still lost, there should be a log file in. $XDG_CACHE_DIR ( ~/Library/Caches on macos?) /sniprun/sniprun.log

PS: it's :checkhealth sniprun not checkhealth SnipRun

I'll be damned,filetype=vimwiki. Once I disabled the plugin (I was going to anyway), it worked just fine.

btw, my original post was incorrect, my config is sh ./install.sh 1 since it requires compiling. I hope you can un-flabber that gast. ;-)

Thank you so much. If someone else comes along and has this issue, here are the parts of the vimwiki config that were set. Perhaps if this is reproducible that vimiwiki format can be added. It is really odd that it tookover the filetype of markdown.

tenor-194483789

-- vim.g.vimwiki_list = {
--   {
--     path = '~/techdocs/',
--     syntax = 'markdown',
--     ext  = '.md',
--   }
-- }
-- vim.g.vimwiki_ext2syntax = {
--   ['.md'] = 'markdown',
--   ['.markdown'] = 'markdown',
--   ['.mdown'] = 'markdown',
-- }
-- use {
--     'vimwiki/vimwiki',
--     config = function()
--       -- vim.g.vimwiki_list = {
--       --   {
--       --     path = '~/techdocs/',
--       --     syntax = 'markdown',
--       --     ext  = '.md',
--       --   }
--       -- }
--       -- vim.g.vimwiki_ext2syntax = {
--       --   ['.md'] = 'markdown',
--       --   ['.markdown'] = 'markdown',
--       --   ['.mdown'] = 'markdown',
--       -- }
--     end
--   }