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