为xonsh提供的另一个异步提示支持的powerline主题。
项目描述
Powerline3
为xonsh提供的另一个类似powerline的异步提示。
为什么还要再一个?
- 它使用
$PROMPT_FIELDS
,不需要单独的函数和渲染器。自从添加了$PROMPT_TOKENS_FORMATTER
以来,可以使用现有的函数集来模拟xonsh提示的powerline主题。 - 异步提示模式也能正常工作。
安装
使用pip进行安装
xpip install xontrib-powerline3
# or: xpip install -U git+https://github.com/jnoortheen/xontrib-powerline3
用法
xontrib load powerline3 prompt_ret_code
# the foreground/background colors of the prompt-fields can be configured as below.
# This works for custom fields as well
# The format is `<prompt-field-name>__pl_colors`. It can be a function returning `tuple[str, str]`
# or set tuples directly as below.
$PROMPT_FIELDS["cwd__pl_colors"] = ("WHITE", "CYAN")
# choose the powerline glyph used
$POWERLINE_MODE = "powerline" # if not set then it will choose random
# available modes: round/down/up/flame/squares/ruiny/lego
# define the prompts using the format style and you are good to go
$PROMPT = "".join(
[
"{vte_new_tab_cwd}",
"{cwd:{}}",
"{gitstatus:{}}",
"{ret_code}",
"{background_jobs}",
os.linesep,
"{full_env_name: 🐍{}}",
"$",
]
)
$RIGHT_PROMPT = "".join(
(
"{long_cmd_duration: ⌛{}}",
"{user: 🤖{}}",
"{hostname: 🖥{}}",
"{localtime: 🕰{}}",
)
)
额外的PROMPT_FIELDS
1. full_env_name
- 当
env_name
- 为
.venv
时,显示父文件夹的名称 - 包含
-py3.*
时(当它是poetry创建时)仅显示项目名称部分
- 为
2. background_jobs
- 显示正在运行的后台作业数量
示例
致谢
此软件包是用 xontrib cookiecutter模板 创建的。
- https://www.nerdfonts.com/cheat-sheet?set=nf-ple-
- https://github.com/romkatv/powerlevel10k#meslo-nerd-font-patched-for-powerlevel10k
类似项目
项目详情
下载文件
下载适合您平台的文件。如果您不确定选择哪个,请了解有关安装包的更多信息。
源代码分发
xontrib-powerline3-0.3.17.tar.gz (8.4 kB 查看哈希值)
构建分发
关闭
xontrib-powerline3-0.3.17.tar.gz 的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | ec17c6267161e77e3c2b8d70d1217dcfdd4f5660794008d1336fa1541756188e |
|
MD5 | 8b2041ac9533dcde3b966552485da61e |
|
BLAKE2b-256 | 0d6a9e7e13038d4902c0d8b607dcc37aa395e66451390bbda80da495a0fc1c76 |
关闭
xontrib_powerline3-0.3.17-py3-none-any.whl 的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 00e26714d1c2ba5e703d695954e85cd861f9070de4bbeb47655bc9c69e255bb6 |
|
MD5 | e9ac23acaedc267a0d8d6af3082d7c46 |
|
BLAKE2b-256 | 55d2fe4cc186f6ae5f9d0ba7ca2f700a15c533113d42e14e157a0f7adbee1010 |