Enable whitespace-mode for Python
This commit is contained in:
parent
d0b5e742d2
commit
9feb0bfa45
1 changed files with 10 additions and 1 deletions
|
@ -4,7 +4,7 @@
|
|||
|
||||
;; Author: Tom Willemse <tom@ryuslash.org>
|
||||
;; Keywords: local
|
||||
;; Version: 20190201004304
|
||||
;; Version: 20190201140623
|
||||
;; Package-Requires: (company-jedi fill-column-indicator flycheck rainbow-delimiters reformatter)
|
||||
|
||||
;; This program is free software; you can redistribute it and/or modify
|
||||
|
@ -36,6 +36,7 @@
|
|||
|
||||
(require 'company)
|
||||
(require 'reformatter)
|
||||
(require 'whitespace)
|
||||
|
||||
(autoload 'hl-indent-mode "hl-indent-mode")
|
||||
|
||||
|
@ -46,6 +47,13 @@ The values are taken from the PEP8 coding standard for Python."
|
|||
(setq-local fill-column 80)
|
||||
(setq-local comment-fill-column 72))
|
||||
|
||||
(defun oni-python-whitespace-mode ()
|
||||
"Set the `whitespace-style' to show the relevat whitespace.
|
||||
In Python buffers it should show any tabs being used and and used
|
||||
for indentation."
|
||||
(setq-local whitespace-style '(face tabs))
|
||||
(whitespace-mode))
|
||||
|
||||
(add-to-list 'company-backends 'company-jedi)
|
||||
|
||||
(reformatter-define python-black
|
||||
|
@ -62,6 +70,7 @@ The values are taken from the PEP8 coding standard for Python."
|
|||
(add-hook 'python-mode-hook 'rainbow-delimiters-mode)
|
||||
(add-hook 'python-mode-hook 'python-black-on-save-mode)
|
||||
(add-hook 'python-mode-hook 'oni-python-set-fill-column)
|
||||
(add-hook 'python-mode-hook 'oni-python-whitespace-mode)
|
||||
|
||||
;;;###autoload(with-eval-after-load 'python (require 'oni-python))
|
||||
|
||||
|
|
Loading…
Reference in a new issue