Today I happened to learn something simple but new!

I use clojure and babashka (a clojure scripting interpreter, kinda) LINK. However, clojure-mode was not activated by default on the .bb files I was writing. Turns out it's really easy to fix!

Emacs uses a variable called auto-mode-alist which contains a list of tuple (file extension, major mode). So we just need to add ours there!

(add-to-list 'auto-mode-alist '("\\.bar\\'" . foo-mode))