diff --git a/modules/lang/python/autoload.el b/modules/lang/python/autoload.el index ea19e6eb6..0abce63de 100644 --- a/modules/lang/python/autoload.el +++ b/modules/lang/python/autoload.el @@ -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))) diff --git a/modules/lang/python/config.el b/modules/lang/python/config.el index b859d062c..76590a545 100644 --- a/modules/lang/python/config.el +++ b/modules/lang/python/config.el @@ -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))))