python: improve ipython + anaconda-mode integration
This commit is contained in:
parent
9d7c420f72
commit
54b32b58da
1 changed files with 16 additions and 12 deletions
|
@ -2,25 +2,30 @@
|
||||||
|
|
||||||
(use-package python
|
(use-package python
|
||||||
:mode ("\\.py\\'" . python-mode)
|
:mode ("\\.py\\'" . python-mode)
|
||||||
:interpreter ("python" . python-mode)
|
:interpreter ("python" . python-mode)
|
||||||
:commands python-mode
|
:commands python-mode
|
||||||
:init
|
:init
|
||||||
(define-docset! python-mode "py,py3,python")
|
|
||||||
(add-hook! python-mode '(emr-initialize narf|flycheck-enable-maybe))
|
|
||||||
(setq-default
|
(setq-default
|
||||||
python-environment-directory narf-temp-dir
|
python-environment-directory narf-temp-dir
|
||||||
python-shell-interpreter "ipython")
|
python-shell-interpreter "ipython"
|
||||||
:config
|
python-shell-interpreter-args "--deep-reload"
|
||||||
|
python-shell-prompt-regexp "In \\[[0-9]+\\]: "
|
||||||
|
python-shell-prompt-block-regexp "\\.\\.\\.\\.: "
|
||||||
|
python-shell-prompt-output-regexp "Out\\[[0-9]+\\]: "
|
||||||
|
python-shell-completion-setup-code
|
||||||
|
"from IPython.core.completerlib import module_completion"
|
||||||
|
python-shell-completion-string-code
|
||||||
|
"';'.join(get_ipython().Completer.all_completions('''%s'''))\n")
|
||||||
|
|
||||||
|
(define-docset! python-mode "py,py3,python")
|
||||||
(define-env-command! python-mode "python --version 2>&1 | cut -d' ' -f2")
|
(define-env-command! python-mode "python --version 2>&1 | cut -d' ' -f2")
|
||||||
(define-repl! python-mode narf/inf-python)
|
(define-repl! python-mode narf/inf-python)
|
||||||
|
(add-hook! python-mode '(emr-initialize narf|flycheck-enable-maybe))
|
||||||
|
|
||||||
;; interferes with smartparens
|
:config
|
||||||
(define-key python-mode-map (kbd "DEL") nil)
|
(define-key python-mode-map (kbd "DEL") nil) ; interferes with smartparens
|
||||||
|
|
||||||
(use-package anaconda-mode
|
(use-package anaconda-mode
|
||||||
:defer t
|
|
||||||
:defines (anaconda-mode-map anaconda-nav-mode-map)
|
|
||||||
:functions (anaconda-mode-running-p)
|
|
||||||
:init
|
:init
|
||||||
(add-hook! python-mode '(anaconda-mode anaconda-eldoc-mode eldoc-mode))
|
(add-hook! python-mode '(anaconda-mode anaconda-eldoc-mode eldoc-mode))
|
||||||
(setq anaconda-mode-installation-directory (concat narf-temp-dir "/anaconda/")
|
(setq anaconda-mode-installation-directory (concat narf-temp-dir "/anaconda/")
|
||||||
|
@ -54,8 +59,7 @@
|
||||||
(use-package nose
|
(use-package nose
|
||||||
:commands nose-mode
|
:commands nose-mode
|
||||||
:preface (defvar nose-mode-map (make-sparse-keymap))
|
:preface (defvar nose-mode-map (make-sparse-keymap))
|
||||||
:init
|
:init (associate! nose-mode :match "/test_.+\\.py\\'")
|
||||||
(associate! nose-mode :match "/test_.+\\.py\\'")
|
|
||||||
:config
|
:config
|
||||||
(map! :map nose-mode-map
|
(map! :map nose-mode-map
|
||||||
(:localleader
|
(:localleader
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue