使用令人惊叹的代码片段使您的 xonsh RC 文件可安装。
Awesome snippets of code for xonshrc in xonsh shell.
If you like the idea click ⭐ on the repo and tweet.
Learn about xonsh run control (RC) files in official docs - Run Control File. You should know about what RC files are used in interactive and non-interactive sessions.
Fork this repository
Rename the repository to xontrib-rc-yourname
Change the name in pyproject.toml ([project] → name)
Change the name of xontrib/rc_awesome.xsh to xontrib/rc_yourname.xsh
Add xontribs you need to pyproject.toml ([project] → dependencies) — they will be installed automatically during pip install
Now you can just run anywhere:
pip install -U git+https://github.com/yourname/xontrib-rc-yourname
# Only for interactive mode:
# (You can also create autoloadable xontrib using xontrib-template. See below.)
echo 'xontrib load rc_yourname' >> ~/.xonshrc
# For interactive or non-interactive (https://xon.sh/xonshrc.html):
# mkdir -p ~/.config/xonsh/rc.d/
# echo 'xontrib load rc_yourname' > ~/.config/xonsh/rc.d/rc_yourname.xsh
xonsh Also you can avoid manual loading the xontrib in ~/.xonshrc by creating autoloadable xontrib using xontrib-template. Answer yes on the question about enabling autoloading.
Increment version in pyproject.toml to update the package using pip install -U git+https://github.com/yourname/xontrib-rc-yourname
Take a look into xonsh-awesome-cli-app if you want to create your own toolset.
Just read rc_awesome and copy the snippets to your xonsh RC.
Or add awesome xonsh RC to the end of your xonshrc:
curl -s https://raw.githubusercontent.com/anki-code/xontrib-rc-awesome/main/xontrib/rc_awesome.xsh >> ~/.xonshrcOr install awesome xonsh RC as a package with automatically installable xontribs:
pip install -U git+https://github.com/anki-code/xontrib-rc-awesome
echo 'xontrib load rc_awesome' >> ~/.xonshrc
xonsh暂无开放 Issues,或尚未同步最近议题。