Detect Babashka `.bb` file extension as Clojure
axvr opened this issue · 6 comments
Also detect .clj_kondo extension for clj-kondo hooks.
Is this something as simple as adding *.clj_kondo and *.bb to ftdetect/clojure.vim?
And ftplugin/clojure.vim, too?
Hi, yes it is, but when merging upstream to Vim, I may also need to manually add the bb shebang to the Vim source code too to detect babashka files without a file extension.
Would it be OK if I work on this and submit a PR?
Yes, of course :)
Thank you @russtoku. After some changes due to .bb extension colliding with BitBake's file extension this is now implemented but with some caveats.
The detection of unofficial Clojure files and file extensions such as *.bb, *.clj_kondo, build.boot and profile.boot are only active when this repository is installed as a (Neo)Vim plugin rather than being something built into (Neo)Vim. If you have this repo installed as a plugin but do not want unofficial file extensions detected, you can turn it off with:
let g:clojure_detect_unofficial_exts = 0If you don't want this plugin installed but want this anyway, you can add the following to your Vim config:
autocmd BufNewFile,BufRead {build,profile}.boot,*.bb,*.clj_kondo setlocal filetype=clojure