diff --git a/modules/lang/python/config.el b/modules/lang/python/config.el index 5ee85feef..f23c48975 100644 --- a/modules/lang/python/config.el +++ b/modules/lang/python/config.el @@ -16,6 +16,16 @@ (setq python-environment-directory doom-cache-dir python-indent-guess-indent-offset-verbose nil python-shell-interpreter "python") + (when (featurep! +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")) :config (set-env! "PYTHONPATH" "PYENV_ROOT" "ANACONDA_HOME") (set-electric! 'python-mode :chars '(?:)) @@ -45,17 +55,6 @@ sp-point-after-word-p sp-point-before-same-p))) - (when (featurep! +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")) - (setq-hook! 'python-mode-hook tab-width python-indent-offset) ;; Add python/pipenv version string to the major mode in the modeline