[emacs] Add Elpy.
This commit is contained in:
parent
a5dc90cf8c
commit
3f7eeabc0a
@ -77,7 +77,7 @@
|
|||||||
|
|
||||||
;; Retrieve PATH from fish shell
|
;; Retrieve PATH from fish shell
|
||||||
(when (memq window-system '(mac ns x))
|
(when (memq window-system '(mac ns x))
|
||||||
(setq exec-path-from-shell-shell-name "/usr/local/bin/fish")
|
(setq exec-path-from-shell-shell-name "/usr/bin/fish")
|
||||||
(exec-path-from-shell-initialize))
|
(exec-path-from-shell-initialize))
|
||||||
|
|
||||||
;; Auto complete + Yasnippet
|
;; Auto complete + Yasnippet
|
||||||
@ -128,9 +128,6 @@
|
|||||||
company-jedi
|
company-jedi
|
||||||
company-web-html)))
|
company-web-html)))
|
||||||
(add-hook 'LaTeX-mode-hook 'company-auctex-init)
|
(add-hook 'LaTeX-mode-hook 'company-auctex-init)
|
||||||
(add-hook 'python-mode-hook
|
|
||||||
(lambda ()
|
|
||||||
(setq-local company-backends '(company-jedi))))
|
|
||||||
:config
|
:config
|
||||||
(add-hook 'after-init-hook 'global-company-mode)
|
(add-hook 'after-init-hook 'global-company-mode)
|
||||||
(global-set-key (kbd "M-/") 'company-complete)
|
(global-set-key (kbd "M-/") 'company-complete)
|
||||||
@ -189,6 +186,10 @@
|
|||||||
(forward-char 1))))
|
(forward-char 1))))
|
||||||
count)))))
|
count)))))
|
||||||
|
|
||||||
|
(add-to-list 'LaTeX-verbatim-environments "code")
|
||||||
|
(add-to-list 'LaTeX-indent-environment-list
|
||||||
|
'("code" current-indentation))
|
||||||
|
|
||||||
(add-hook 'LaTeX-mode-hook 'my-latex-mode-setup)
|
(add-hook 'LaTeX-mode-hook 'my-latex-mode-setup)
|
||||||
(add-hook 'LaTeX-mode-hook 'visual-line-mode)
|
(add-hook 'LaTeX-mode-hook 'visual-line-mode)
|
||||||
(add-hook 'LaTeX-mode-hook 'flyspell-mode)
|
(add-hook 'LaTeX-mode-hook 'flyspell-mode)
|
||||||
@ -224,7 +225,7 @@
|
|||||||
|
|
||||||
(add-hook 'before-save-hook 'whitespace-cleanup)
|
(add-hook 'before-save-hook 'whitespace-cleanup)
|
||||||
|
|
||||||
(add-hook 'python-mode-hook (lambda () (setq-local whitespace-line-column 140)))
|
(add-hook 'python-mode-hook (lambda () (setq-local whitespace-line-column 100)))
|
||||||
(add-hook 'LaTeX-mode-hook (lambda () (setq-local whitespace-line-column -1)))
|
(add-hook 'LaTeX-mode-hook (lambda () (setq-local whitespace-line-column -1)))
|
||||||
(add-hook 'web-mode-hook (lambda () (setq-local whitespace-line-column -1)))
|
(add-hook 'web-mode-hook (lambda () (setq-local whitespace-line-column -1)))
|
||||||
|
|
||||||
@ -311,22 +312,22 @@
|
|||||||
(add-hook 'LaTeX-mode-hook 'key-latex-mode-setup)
|
(add-hook 'LaTeX-mode-hook 'key-latex-mode-setup)
|
||||||
|
|
||||||
;; python
|
;; python
|
||||||
|
(use-package elpy
|
||||||
(use-package python-mode
|
:ensure t
|
||||||
:mode "\\.py\\'"
|
:config
|
||||||
:config)
|
(when (load "flycheck" t t)
|
||||||
|
(setq elpy-modules (delq 'elpy-module-flymake elpy-modules))
|
||||||
;; (use-package jedi
|
(add-hook 'elpy-mode-hook 'flycheck-mode))
|
||||||
;; :config
|
(setq python-shell-interpreter "jupyter"
|
||||||
;; (add-hook 'python-mode-hook 'jedi:setup)
|
python-shell-interpreter-args "console --simple-prompt"
|
||||||
;; (setq jedi:complete-on-dot t))
|
python-shell-prompt-detect-failure-warning nil)
|
||||||
|
(add-to-list 'python-shell-completion-native-disabled-interpreters
|
||||||
(use-package cython-mode
|
"jupyter")
|
||||||
:init
|
:init
|
||||||
(require 'python-mode)
|
(setq elpy-rpc-backend "jedi")
|
||||||
(setq python-indent 4)
|
(setq elpy-rpc-python-command "python3")
|
||||||
(setq python-indent-offset 4)
|
(elpy-enable))
|
||||||
:mode "\\.pyx\\'")
|
(add-hook 'python-mode-hook 'hs-minor-mode)
|
||||||
|
|
||||||
;; Web mode
|
;; Web mode
|
||||||
(add-to-list 'auto-mode-alist '("\\.ctp\\'" . web-mode))
|
(add-to-list 'auto-mode-alist '("\\.ctp\\'" . web-mode))
|
||||||
|
@ -34,6 +34,7 @@
|
|||||||
(package-install 'dash)
|
(package-install 'dash)
|
||||||
(package-install 'dash-functional)
|
(package-install 'dash-functional)
|
||||||
(package-install 'diffview)
|
(package-install 'diffview)
|
||||||
|
(package-install 'elpy)
|
||||||
(package-install 'fish-mode)
|
(package-install 'fish-mode)
|
||||||
(package-install 'flycheck)
|
(package-install 'flycheck)
|
||||||
(package-install 'flycheck-color-mode-line)
|
(package-install 'flycheck-color-mode-line)
|
||||||
|
Loading…
Reference in New Issue
Block a user