From: Peng Li Date: Thu, 21 Sep 2017 05:18:11 +0000 (+0800) Subject: Emacs - some font lock face X-Git-Url: http://47.100.26.94:8080/?a=commitdiff_plain;h=5ee171d03a78afb93b3ade7b8b490aaa35333e25;p=dotfiles.git Emacs - some font lock face --- diff --git a/emacs.d/config.org b/emacs.d/config.org index ec33c49..4b7e6f4 100644 --- a/emacs.d/config.org +++ b/emacs.d/config.org @@ -2146,6 +2146,23 @@ Refer, [[http://emacs.stackexchange.com/questions/7908/how-to-make-yasnippet-and (set-face-attribute 'font-lock-keyword-face nil :weight 'bold) (set-face-attribute 'font-lock-builtin-face nil :weight 'bold) #+END_SRC + +#+BEGIN_SRC emacs-lisp :tangle yes :results silent + (font-lock-add-keywords 'c-mode + ;; highlight %s \n + '(("\\([%\\][a-zA-Z]\\)" (1 font-lock-keyword-face prepend)) + ("[^[:alpha:]]\\([[:digit:]]*\\)[^[:alpha:]]" (1 font-lock-constant-face append)))) + + + ;; Also make function calls highlighted + (font-lock-add-keywords 'c-mode + '(("\\s\"?\\(\\(\\sw\\|\\s_\\)+\\(<-\\)?\\)\\s\"?*\\s-*(" + (1 font-lock-function-name-face))) t) + + + +#+END_SRC + ** Emacs Lisp #+BEGIN_SRC emacs-lisp :tangle yes :results silent (use-package color-identifiers-mode @@ -2215,8 +2232,9 @@ Refer [[https://www.emacswiki.org/emacs/AutoInsertMode][AutoInsertMode]] Wiki (font-lock-add-keywords 'cperl-mode '(("\\(say\\)" . cperl-nonoverridable-face) ("\\([0-9.]\\)*" . font-lock-constant-face) - ("\".*\\(\\\n\\).*\"" . font-lock-constant-face) - ("\n" . font-lock-constant-face) + ("\".*\\(\\\n\\).*\"" 1 font-lock-constant-face prepend) + ("\n" 0 font-lock-constant-face prepend) + ;; ("[%\\][[:alpha:]]" . font-lock-constant-face) ("\\(^#!.*\\)$" . cperl-nonoverridable-face))) #+END_SRC diff --git a/emacs.d/emacs-evil.org b/emacs.d/emacs-evil.org index ca30b23..c66dc9e 100644 --- a/emacs.d/emacs-evil.org +++ b/emacs.d/emacs-evil.org @@ -22,7 +22,7 @@ https://www.emacswiki.org/emacs/Evil. (setq evil-replace-state-cursor '("red" bar)) (setq evil-operator-state-cursor '("red" hollow)) ;; others, don't move back cursor when exit insert mode - (setq evil-move-cursor-back nil) + ;; (setq evil-move-cursor-back nil) :config (use-package evil-leader :ensure t