andymass / vim-matchup

vim match-up: even better % :facepunch: navigate and highlight matching words :facepunch: modern matchit and matchparen. Supports both vim and neovim + tree-sitter.
https://www.vim.org/scripts/script.php?script_id=5624
MIT License
1.65k stars 65 forks source link

.njk (Nunjucks) support? #297

Open antgel opened 1 year ago

antgel commented 1 year ago

Hi and thanks for this great plugin. I took the liberty of not filling in the template because I suspect the "bug" might be PBKAC. The plugin works great on *.html files, however when I load *.njk (Nunjucks) files, it doesn't load. Is this a bug or a feature, and if the latter, how do I enable the plugin?

I would be happy for the plugin to be active "only" on HTML tags for now, the Nunjucks {{ }} delimiters tend to be short hence the plugin is less relevant.

(Been using vi(m) for 30 years and only now am I starting to get to grips with Lua etc :man_facepalming: )

andymass commented 1 year ago

You should be able to get something simple working via

au FileType nunjucks let b:match_words = matchup#util#standard_html()
au BufNewFile,BufRead *.njk setf nunjucks

In your config, although I didn't test it.