Associate flake.lock with json-mode/js-mode
This commit is contained in:
parent
4d7640b4c2
commit
589e5a37af
1 changed files with 8 additions and 0 deletions
|
@ -10,6 +10,14 @@
|
|||
(use-package! nix-mode
|
||||
:interpreter ("\\(?:cached-\\)?nix-shell" . +nix-shell-init-mode)
|
||||
:mode "\\.nix\\'"
|
||||
:init
|
||||
;; Treat flake.lock files as json. Fall back to js-mode because it's faster
|
||||
;; than js2-mode, and its extra features aren't needed there.
|
||||
(add-to-list 'auto-mode-alist
|
||||
(cons "/flake\\.lock\\'"
|
||||
(if (featurep! :lang json)
|
||||
'json-mode
|
||||
'js-mode)))
|
||||
:config
|
||||
(set-repl-handler! 'nix-mode #'+nix/open-repl)
|
||||
(set-company-backend! 'nix-mode 'company-nixos-options)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue