一段时间以来,我一直在尝试将我的 %edit 编辑器设置为 Emacs,但进展非常缓慢。
IPython 0.13 文档不清楚如何实际配置它。它告诉我通过添加
将 EDITOR 设置为所需的编辑器(在我的例子中是“emacsclient”)c = get_config()
c.InteractiveShell.editor = 'emacsclient'
到我的 ipython 文件夹中的配置。
但是,我找不到任何这样的文件夹。我花了很长时间四处寻找如何设置 IPython 环境变量,但只找到了相关的片段。使用什么代码。启动脚本的 .py 和 .ipy 文件之间的区别。等等
我正在使用 Ubuntu 12.10。 IPython 0.13 的配置文件放在哪里?
最佳答案
我在 ~/.config/ipython/profile_default/ipython_config.py
中有 c.TerminalInteractiveShell.editor = 'emacsclient'
并且它有效。
如果您找不到配置位置,请使用 ipython locate profile
命令:
http://ipython.org/ipython-doc/rel-0.13/whatsnew/version0.13.html#new-top-level-locate-command
但我认为设置编辑器的最简单方法是在您的 shell 设置中使用类似 export EDITOR=emacsclient
的东西(例如 ~/.bashrc
).
关于python - 我在哪里放置 IPython 配置文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15403523/