lang/sh: add keywords for fontification

This commit is contained in:
Henrik Lissner 2017-06-20 23:33:22 +02:00
parent 5fb62e6041
commit 1fd27f16b3
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -1,7 +1,9 @@
;;; lang/sh/config.el -*- lexical-binding: t; -*- ;;; lang/sh/config.el -*- lexical-binding: t; -*-
(defvar +sh-builtin-keywords (defvar +sh-builtin-keywords
'("sudo" "echo" "ls" "sleep" "tee" "cd" "cat") '("cat" "cat" "cd" "chmod" "chown" "cp" "curl" "date" "echo" "find" "git"
"grep" "head" "kill" "less" "ls" "make" "mkdir" "mv" "pgrep" "pkill" "pwd"
"rm" "sleep" "sudo" "tail" "tee" "touch")
"A list of common shell commands and keywords to be fontified especially in "A list of common shell commands and keywords to be fontified especially in
`sh-mode'.") `sh-mode'.")
@ -30,8 +32,8 @@
(2 'font-lock-variable-name-face prepend)) (2 'font-lock-variable-name-face prepend))
(+sh--match-command-subst-in-quotes (+sh--match-command-subst-in-quotes
(0 'sh-quoted-exec prepend)) (0 'sh-quoted-exec prepend))
(,(concat "^\\s-*" (regexp-opt +sh-builtin-keywords 'words)) (,(regexp-opt +sh-builtin-keywords 'words)
(0 'font-lock-builtin-face t)))) (0 'font-lock-builtin-face append))))
;; sh-mode has file extensions checks for other shells, but not zsh, so... ;; sh-mode has file extensions checks for other shells, but not zsh, so...
(defun +sh|detect-zsh () (defun +sh|detect-zsh ()