如何永久保存ipython alias?

如何永久保存ipython alias?,ipython,Ipython,我对如何保存ipython别名有点困惑,因此每次我打开ipython会话(首先保存alias之后)并直接使用alias命令时(此时,您不应该再次输入别名)。 例如,在linux(或windows)中使用ipython时,我会使用vi而不是!vi文件 vi文件名 !vi filename要在profile_default下的ipython目录中生成默认配置文件ipython_config.py,请执行以下操作: 在linux/windows中查找ipython_config.py 编辑ipytho

我对如何保存ipython别名有点困惑,因此每次我打开ipython会话(首先保存alias之后)并直接使用alias命令时(此时,您不应该再次输入别名)。 例如,在linux(或windows)中使用ipython时,我会使用vi而不是!vi文件

vi文件名
!vi filename
要在profile_default下的ipython目录中生成默认配置文件ipython_config.py,请执行以下操作: 在linux/windows中查找ipython_config.py 编辑ipython_config.py文件以添加砍伐内容 保存该文件并退出并获取该文件,以便在profile_default下的ipython目录中生成默认配置文件ipython_config.py: 在linux/windows中查找ipython_config.py 编辑ipython_config.py文件以添加砍伐内容 保存文件并退出并获取它thx@jack杨

一,。
emacs~/.ipython/profile\u default/python\u config.py

2.到头来,我们还是放弃了
c.AliasManager.user_aliases=[('e','emacsclient-t')]

3.退出并重新启动ipythonthx@jack杨

一,。
emacs~/.ipython/profile\u default/python\u config.py

2.到头来,我们还是放弃了
c.AliasManager.user_aliases=[('e','emacsclient-t')]

3.退出并重新启动ipython

$ ipython profile create
#use find command in linux
find / -name ipython_config.py
#in window,you can use all kinds of tools to search .
#in commands line,you can use 
ipython locate profile.
#in the directory,you can get it
c = get_config()
c.TerminalIPythonApp.display_banner = True
c.InteractiveShellApp.log_level = 20
c.InteractiveShellApp.extensions = []
c.InteractiveShellApp.exec_lines = []
c.InteractiveShellApp.exec_files = ['mycode.py']#load Module when open ipython
c.InteractiveShell.autoindent = True
c.InteractiveShell.colors = 'LightBG'#ipython console color
c.InteractiveShell.confirm_exit = False
c.InteractiveShell.editor = 'vim'#you can change your favorite editor
c.InteractiveShell.xmode = 'Context'
c.PrefilterManager.multi_line_specials = True
#you can add your alias in the fellowing list
c.AliasManager.user_aliases = [('vi','vim'),('py','python'),('git','git'),]#i add git ,vim python .i really dislike "!"