lang/python: add ipython REPL support
This commit is contained in:
parent
9254e1b076
commit
0e63ad913d
2 changed files with 13 additions and 10 deletions
|
@ -4,4 +4,4 @@
|
|||
(defun +python/repl ()
|
||||
"Open the Python REPL."
|
||||
(interactive)
|
||||
(process-buffer (run-python python-shell-interpreter t t)))
|
||||
(process-buffer (run-python nil t t)))
|
||||
|
|
|
@ -5,15 +5,7 @@
|
|||
:init
|
||||
(setq python-environment-directory doom-cache-dir
|
||||
python-indent-guess-indent-offset-verbose nil
|
||||
python-shell-interpreter "python"
|
||||
python-shell-interpreter-args nil
|
||||
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")
|
||||
python-shell-interpreter "python")
|
||||
|
||||
(add-hook! 'python-mode-hook
|
||||
#'(flycheck-mode +evil|simple-matchit))
|
||||
|
@ -23,6 +15,17 @@
|
|||
(set! :electric 'python-mode :chars '(?:))
|
||||
(define-key python-mode-map (kbd "DEL") nil) ; interferes with smartparens
|
||||
|
||||
(when (executable-find "ipython")
|
||||
(setq python-shell-interpreter "ipython"
|
||||
python-shell-interpreter-args "-i --simple-prompt --no-color-info"
|
||||
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"))
|
||||
|
||||
(sp-with-modes 'python-mode
|
||||
(sp-local-pair "'" nil :unless '(sp-point-before-word-p sp-point-after-word-p sp-point-before-same-p))))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue