ipython repl的流行主题

ipython-agnoster的Python项目详细描述


ipython agnoster(又名ipster)是ipython repl的一个流行主题。 它的设计目的是提供前后一致的终端体验 Agnoster Zsh theme叉子。

ipster是为那些使用:

  • 日光配色方案;
  • Unicode兼容字体。
对于GNOME GNU/Linux用户,我强烈推荐GNOME Terminal+Solarized Dark+Dejavu Sans Mono Nerd。
对于kde gnu/linux用户,我强烈推荐konsole+Solarized Dark+dejavu sans mono nerd。
对于Mac用户,我强烈推荐Iterm 2+日光暗版。
With some extra hassle this theme works on Windows too.

安装

对于IPython>=5.0,请安装程序包:

pip install -U pip setuptools  # update environment markers support
pip install ipython-agnoster

对于IPython>=0.11,<5.0,克隆存储库并复制ipster 扩展目录的模块(已弃用):

git clone --depth=1 https://github.com/i5ar/ipster.git
cd ipster
cp -r ipster "$HOME/.ipython/extensions"

配置

安装模块后,需要对其进行配置。

编辑配置文件 ~/.ipython/profile_default/ipython_config.py

## Use 24bit colors instead of 256 colors in prompt highlighting.
c.TerminalInteractiveShell.true_color = True

## Set the color scheme (NoColor, Neutral, Linux, or LightBG).
c.InteractiveShell.colors = 'Linux'

##
c.InteractiveShell.separate_in = ''

对于IPython>=5.0,只添加以下行:

from ipster.since_5 import IPsterPrompts, IPsterStyle

c.TerminalInteractiveShell.prompts_class = IPsterPrompts

highlighting_ipstyle = IPsterStyle().overrides_linux()
c.TerminalInteractiveShell.highlighting_style_overrides = highlighting_ipstyle

对于IPython>=0.11,<5.0,只添加以下行(不推荐):

from pygments.token import Token

# Define prompt colors
style_overrides_linux = {
    Token.IPsterPromptVirtualenv: 'bg:#859900 #073642',
    Token.IPsterPowerlinePromptVirtualenv: 'bg:#073642 #859900',
    Token.Prompt: 'bg:#073642 #839496',
    Token.PromptNum: 'bg:#073642 #859900 bold',
    Token.OutPrompt: 'bg:#073642 #839496',
    Token.OutPromptNum: 'bg:#073642 #dc322f bold',
    Token.IPsterPowerlinePrompt: '#073642',
    Token.IPsterPromptSpace: '#839496',
}

# Override prompt colors
c.TerminalInteractiveShell.highlighting_style_overrides = style_overrides_linux

# Load extension
c.InteractiveShellApp.extensions = [
    'ipster.post_0_11'
]

兼容性

tmux

必须在配置文件中启用真彩色支持 ~/.tmux.conf日光配色方案正常工作:

# Override screen 256 color with true color
set-option -ga terminal-overrides ",xterm-256color:Tc"

如果这个修复不起作用,您的tmux版本可能太旧了。

路线图

使用IPython shortcuts时 对于vi模式,当前模式指示可能非常有用。会的 如果ipster能以正确的提示显示vi模式,那就太好了。

贡献

欢迎提出建议和请求。

额外费用

如果您已经为ipython使用了powerline,请在下面安装ipster主题 请输入extras目录。

待办事项

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java实现的一个简单算法(计算概率)   更改应用程序背景动画的java首选项   java捕获图像并通过socket发送   基于双精度数组的对象的java排序Arraylist?   java似乎无法获得前面数字的正确总和   java卡住了Tomcat线程。日食乐观锁定   java是一个异步的Throwable类的printStackTrace()   java随机错误(可能是)Android支持库   java我应该在代码中自动创建DB表,还是在安装过程中使用preinit?   在被调用的方法/函数Java/Android中处理异常?   arraylist Java发送电子邮件非法分号?   while循环中的Java数组   java Arquillian和TransactionAttribute类型。需要新的   java“未找到合适的驱动程序”获取此错误   java高性能地将子类转换为真正的超类   java如何从另一个活动访问变量   安卓 Java Kotlin泛型将类getter作为参数传递到函数中   尝试访问数组的某个位置时需要java“]”