Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detect Babashka .bb file extension as Clojure #38

Closed
axvr opened this issue Aug 6, 2023 · 6 comments
Closed

Detect Babashka .bb file extension as Clojure #38

axvr opened this issue Aug 6, 2023 · 6 comments
Labels
enhancement New feature or request good first issue Good for newcomers highlighting Affects syntax highlighting

Comments

@axvr
Copy link
Member

axvr commented Aug 6, 2023

No description provided.

@axvr axvr added enhancement New feature or request highlighting Affects syntax highlighting labels Aug 6, 2023
@axvr
Copy link
Member Author

axvr commented Aug 7, 2023

Also detect .clj_kondo extension for clj-kondo hooks.

@russtoku
Copy link
Contributor

russtoku commented Sep 27, 2024

Is this something as simple as adding *.clj_kondo and *.bb to ftdetect/clojure.vim?

And ftplugin/clojure.vim, too?

@axvr
Copy link
Member Author

axvr commented Nov 8, 2024

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.

@russtoku
Copy link
Contributor

russtoku commented Nov 8, 2024

Would it be OK if I work on this and submit a PR?

@axvr
Copy link
Member Author

axvr commented Nov 8, 2024

Yes, of course :)

@axvr
Copy link
Member Author

axvr commented Nov 15, 2024

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 = 0

If 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

@axvr axvr closed this as completed Nov 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers highlighting Affects syntax highlighting
Projects
None yet
Development

No branches or pull requests

2 participants