Add highlight-numbers-mode to python & elisp

This commit is contained in:
Henrik Lissner 2017-06-07 14:36:24 +02:00
parent 4aece988ff
commit be46654629
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
2 changed files with 5 additions and 3 deletions

View file

@ -24,7 +24,6 @@
(add-hook 'before-save-hook #'delete-trailing-whitespace nil t) (add-hook 'before-save-hook #'delete-trailing-whitespace nil t)
(eldoc-mode +1) (eldoc-mode +1)
(highlight-quoted-mode +1)
(auto-compile-on-save-mode +1) (auto-compile-on-save-mode +1)
(rainbow-delimiters-mode +1) (rainbow-delimiters-mode +1)
@ -32,6 +31,9 @@
(not (file-in-directory-p buffer-file-name doom-emacs-dir))) (not (file-in-directory-p buffer-file-name doom-emacs-dir)))
(flycheck-mode +1)) (flycheck-mode +1))
;; improve fontification
(highlight-quoted-mode +1)
(highlight-numbers-mode +1)
(font-lock-add-keywords (font-lock-add-keywords
nil `(;; Display "lambda" as λ nil `(;; Display "lambda" as λ
("(\\(lambda\\)" (1 (ignore (compose-region (match-beginning 1) (match-end 1) #'decompose-region)))) ("(\\(lambda\\)" (1 (ignore (compose-region (match-beginning 1) (match-end 1) #'decompose-region))))

View file

@ -7,9 +7,9 @@
python-indent-guess-indent-offset-verbose nil python-indent-guess-indent-offset-verbose nil
python-shell-interpreter "python") python-shell-interpreter "python")
(add-hook 'python-mode-hook #'flycheck-mode)
:config :config
(add-hook! 'python-mode-hook #'(flycheck-mode highlight-numbers-mode))
(set! :repl 'python-mode #'+python/repl) (set! :repl 'python-mode #'+python/repl)
(set! :electric 'python-mode :chars '(?:)) (set! :electric 'python-mode :chars '(?:))
(define-key python-mode-map (kbd "DEL") nil) ; interferes with smartparens (define-key python-mode-map (kbd "DEL") nil) ; interferes with smartparens