我在哪里放置IPython配置文件?

时间:2013-03-14 07:30:54

标签: python emacs editor ipython

我一直试图将我的%编辑编辑器设置为Emacs一段时间,并且进展非常缓慢。

IPython 0.13文档还不清楚如何实际配置它。它告诉我通过添加

将EDITOR设置为所需的编辑器(在我的情况下,“emacsclient”)
c = get_config()
c.InteractiveShell.editor = 'emacsclient'

到我的ipython文件夹中的配置。

但是,我找不到任何这样的文件夹。我花了很长时间四处寻找如何设置IPython环境变量并找到相关的片段。使用什么代码。启动脚本的.py和.ipy文件之间的区别。等

我正在使用Ubuntu 12.10。我在哪里把配置文件放到IPython 0.13上?

1 个答案:

答案 0 :(得分:16)

我在c.TerminalInteractiveShell.editor = 'emacsclient'中有~/.config/ipython/profile_default/ipython_config.py并且有效。

如果您在查找配置位置时遇到问题,请使用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)。