Bump :tools direnv
purcell/envrc@da8e306 -> purcell/envrc@18caf51 envrc-mode now provides its own envrc file major mode with basic syntax highlighting.
This commit is contained in:
parent
da54fa98ce
commit
ecca37b07b
2 changed files with 2 additions and 21 deletions
|
@ -1,20 +1,8 @@
|
||||||
;;; tools/direnv/config.el -*- lexical-binding: t; -*-
|
;;; tools/direnv/config.el -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
(defvar +direnv-keywords
|
|
||||||
'("direnv_layout_dir" "PATH_add" "path_add" "log_status" "log_error" "has"
|
|
||||||
"join_args" "expand_path" "dotenv" "user_rel_path" "find_up" "source_env"
|
|
||||||
"watch_file" "source_up" "direnv_load" "MANPATH_add" "load_prefix" "layout"
|
|
||||||
"use" "rvm" "use_nix" "use_guix")
|
|
||||||
"A list of direnv keywords, which are fontified when in `+direnv-rc-mode'.")
|
|
||||||
|
|
||||||
|
|
||||||
;;
|
|
||||||
;;; Packages
|
|
||||||
|
|
||||||
(use-package! envrc
|
(use-package! envrc
|
||||||
:when (executable-find "direnv")
|
:when (executable-find "direnv")
|
||||||
:after-call doom-first-file-hook
|
:after-call doom-first-file-hook
|
||||||
:mode ("\\.envrc\\'" . +direnv-rc-mode)
|
|
||||||
:config
|
:config
|
||||||
(add-to-list 'doom-debug-variables 'envrc-debug)
|
(add-to-list 'doom-debug-variables 'envrc-debug)
|
||||||
|
|
||||||
|
@ -33,18 +21,11 @@
|
||||||
;; Ensure these local variables survive major mode changes, so envrc-mode is
|
;; Ensure these local variables survive major mode changes, so envrc-mode is
|
||||||
;; only "activated" once per buffer.
|
;; only "activated" once per buffer.
|
||||||
(put 'envrc-mode 'permanent-local t)
|
(put 'envrc-mode 'permanent-local t)
|
||||||
|
(put 'envrc--status 'permanent-local t)
|
||||||
(put 'process-environment 'permanent-local t)
|
(put 'process-environment 'permanent-local t)
|
||||||
(put 'exec-path 'permanent-local t)
|
(put 'exec-path 'permanent-local t)
|
||||||
(put 'eshell-path-env 'permanent-local t)
|
(put 'eshell-path-env 'permanent-local t)
|
||||||
|
|
||||||
(define-derived-mode +direnv-rc-mode sh-mode "envrc"
|
|
||||||
"Major mode for .envrc files."
|
|
||||||
;; Fontify .envrc keywords; it's a good indication of whether or not we've
|
|
||||||
;; typed them correctly, and that we're in the correct major mode.
|
|
||||||
(font-lock-add-keywords
|
|
||||||
nil `((,(regexp-opt +direnv-keywords 'symbols)
|
|
||||||
(0 font-lock-keyword-face)))))
|
|
||||||
|
|
||||||
(defadvice! +direnv--fail-gracefully-a (&rest _)
|
(defadvice! +direnv--fail-gracefully-a (&rest _)
|
||||||
"Don't try to use direnv if the executable isn't present."
|
"Don't try to use direnv if the executable isn't present."
|
||||||
:before-while #'envrc-mode
|
:before-while #'envrc-mode
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
;; -*- no-byte-compile: t; -*-
|
;; -*- no-byte-compile: t; -*-
|
||||||
;;; tools/direnv/packages.el
|
;;; tools/direnv/packages.el
|
||||||
|
|
||||||
(package! envrc :pin "da8e306b0a562af05c5e990aced968d7fda06296")
|
(package! envrc :pin "18caf5154f61d7f78cd4719d999e0fa6ef52345f")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue