wlangstroth / vim-racket

vim bundle for Racket
MIT License
234 stars 60 forks source link

Add options for disabling lang tag detection #77

Open glyh opened 2 years ago

glyh commented 2 years ago

This plugin set filetype according to lang tag, which make it diffcult to integrate with other plugins, e.g. conjure.

benknoble commented 2 years ago

Hi @glyh, I'm the one that advocated for and implemented this feature. (The most up-to-date version is effectively my fork https://github.com/benknoble/vim-racket.) The intent was to make non-Racket-looking (or feeling) #langs into custom filetypes so that syntax, indent, and ftplugin scripts could more accurately target and describe those files. (As an example, my fork contains both #lang info and #lang jsond detection and syntaxes.)

You may be interested to know that the entire #lang + ftdetect system is overridable, starting with a handful of (probably under-documented) variables you can tweak and ending with overriding the ftdetect with your own. I have successfully used this to map custom languages to the desired filetypes even when those languages aren't part of the general racket ecosystem (e.g., they are private). I'm also expanding the default list all the time to try to provide better support for the standard and commonly used languages.

Please let me know if something about configuring this system is unclear!