mirror of
https://github.com/SqrtMinusOne/dotfiles.git
synced 2025-12-10 19:23:03 +03:00
feat(emacs): add global yapf
This commit is contained in:
parent
9b8459b587
commit
b576436028
3 changed files with 16 additions and 2 deletions
5
.config/yapf/style
Normal file
5
.config/yapf/style
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
; [[file:../../Emacs.org::*yapf][yapf:2]]
|
||||
[style]
|
||||
based_on_style = facebook
|
||||
column_limit = 80
|
||||
; yapf:2 ends here
|
||||
|
|
@ -1929,7 +1929,8 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer."
|
|||
:keymaps 'python-mode-map
|
||||
"rr" (lambda ()
|
||||
(interactive)
|
||||
(py-isort-buffer)
|
||||
(unless (and (fboundp #'org-src-edit-buffer-p) (org-src-edit-buffer-p))
|
||||
(py-isort-buffer))
|
||||
(yapfify-buffer)))
|
||||
|
||||
(use-package sphinx-doc
|
||||
|
|
|
|||
10
Emacs.org
10
Emacs.org
|
|
@ -2915,6 +2915,13 @@ References:
|
|||
yapfify-region-or-buffer
|
||||
yapf-mode))
|
||||
#+end_src
|
||||
|
||||
Global config:
|
||||
#+begin_src conf-windows :tangle .config/yapf/style :comments link
|
||||
[style]
|
||||
based_on_style = facebook
|
||||
column_limit = 80
|
||||
#+end_src
|
||||
*** isort
|
||||
[[https://github.com/PyCQA/isort][isort]] is a Python package to sort Python imports.
|
||||
|
||||
|
|
@ -2934,7 +2941,8 @@ The following bindings calls yapf & isort on the buffer
|
|||
:keymaps 'python-mode-map
|
||||
"rr" (lambda ()
|
||||
(interactive)
|
||||
(py-isort-buffer)
|
||||
(unless (and (fboundp #'org-src-edit-buffer-p) (org-src-edit-buffer-p))
|
||||
(py-isort-buffer))
|
||||
(yapfify-buffer)))
|
||||
#+end_src
|
||||
*** sphinx-doc
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue