tools/direnv: fontify direnv stdlib keywords
This commit is contained in:
parent
b6a469f13d
commit
9733db65d2
1 changed files with 13 additions and 0 deletions
|
@ -1,5 +1,12 @@
|
|||
;;; 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")
|
||||
"TODO")
|
||||
|
||||
(def-package! direnv
|
||||
:after-call (after-find-file dired-initial-position-hook)
|
||||
:config
|
||||
|
@ -14,6 +21,12 @@ buffer/window/frame switch, which is less expensive."
|
|||
(add-hook 'focus-in-hook #'direnv--maybe-update-environment)))
|
||||
(add-hook 'direnv-mode-hook #'+direnv|init)
|
||||
|
||||
(defun +direnv|envrc-fontify-keywords ()
|
||||
(font-lock-add-keywords
|
||||
nil `((,(regexp-opt +direnv--keywords 'symbols)
|
||||
(0 font-lock-keyword-face)))))
|
||||
(add-hook 'direnv-envrc-mode-hook #'+direnv|envrc-fontify-keywords)
|
||||
|
||||
(defun +direnv*update (&rest _)
|
||||
"Update direnv. Useful to advise functions that may run
|
||||
environment-sensitive logic like `flycheck-default-executable-find'. This fixes
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue