I forget to enter
sh-mode when I create new shell scripts in
~/.local/bin, so I want emacs to do this automatically. Because I have an advice set up to make them executable, this will have the effect of also marking them executable automatically.
I tried creating this
.dir-locals.el file in the directory:
((nil . ((magic-fallback-mode-alist . (("^$" . sh-mode))))))
but although it asked me whether to apply the "risky" file-local variable
magic-fallback-mode-alist, it did not work - the new buffer was still using fundamental-mode.