lervag / wiki-ft.vim

Simple Vim filetype plugin for wiki-files
MIT License
14 stars 5 forks source link

Add option g:wiki_filetypes to support different filetypes #9

Closed BirgerNi closed 2 years ago

BirgerNi commented 2 years ago

The plugin does not work for me out of the box. Since I use *.md and *.Rmd as file extension the filetype for my wiki files is markdown.

The command let g:wiki_loaded=1 does not activate the plugin for me.

The following workaround work for me:

autocmd BufRead,BufNewFile *.Rmd set filetype=wiki
autocmd BufRead,BufNewFile *.md set filetype=wiki

However, an option like g:wiki_filetypes would feel more natural for me:

let g:wiki_filetypes = ['wiki', 'markdown']

What do you think?

lervag commented 2 years ago

Ah, well, I never intended for this plugin to be a Markdown plugin. This plugin, wiki-ft.vim, is a very lightweight syntax plugin that I made when I migrated from Vimwiki to what became wiki.vim. Initially it was part of wiki.vim, but then I made wiki.vim filetype agnostic. wiki-ft.vim was extracted because I still use the .wiki extension for my own wiki and I've found that the subset of Markdown that is provided here is sufficient for me for the wiki stuff.

But if you're already writing Markdown .md files, then I would think it is actually better to use a more dedicated filetype and syntax plugin. There are a lot of different ones out there, e.g.:

I personally use plasticboy/vim-markdown myself for Markdown files, although I know the pandoc version should also work well.

BirgerNi commented 2 years ago

Thank you for clarification. Since yaml header #11 are important to me I guess I have to switch to one of these options. Maybe one day also treesitter will be good enough to handle markdown syntax and folding.

lervag commented 2 years ago

No problem. And yes, I hope treesitter may become good enough. It is not yet, in my experience.

lervag commented 2 years ago

And sorry for the inconvenience, by the way. :\

BirgerNi commented 2 years ago

No problem. And yes, I hope treesitter may become good enough. It is not yet, in my experience.

Same here. At least for markdown.