mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-02-12 05:49:47 +08:00
Compare commits
4 Commits
f36c6db0ea
...
b75b01a309
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b75b01a309 | ||
|
|
7105e37ef0 | ||
|
|
ee857e3acf | ||
|
|
974055f638 |
17
README.md
17
README.md
@ -13,7 +13,8 @@ Finally, you'll begin to get the sort of attention that you have always felt you
|
|||||||
To learn more, visit [ohmyz.sh](https://ohmyz.sh), follow [@ohmyzsh](https://twitter.com/ohmyzsh) on Twitter, and join us on [Discord](https://discord.gg/ohmyzsh).
|
To learn more, visit [ohmyz.sh](https://ohmyz.sh), follow [@ohmyzsh](https://twitter.com/ohmyzsh) on Twitter, and join us on [Discord](https://discord.gg/ohmyzsh).
|
||||||
|
|
||||||
[](https://github.com/ohmyzsh/ohmyzsh/actions?query=workflow%3ACI)
|
[](https://github.com/ohmyzsh/ohmyzsh/actions?query=workflow%3ACI)
|
||||||
[](https://twitter.com/intent/follow?screen_name=ohmyzsh)
|
[](https://twitter.com/intent/follow?screen_name=ohmyzsh)
|
||||||
|
[](https://mstdn.social/@ohmyzsh)
|
||||||
[](https://discord.gg/ohmyzsh)
|
[](https://discord.gg/ohmyzsh)
|
||||||
[](https://gitpod.io/#https://github.com/ohmyzsh/ohmyzsh)
|
[](https://gitpod.io/#https://github.com/ohmyzsh/ohmyzsh)
|
||||||
[](https://huntr.dev/bounties/disclose/?utm_campaign=ohmyzsh%2Fohmyzsh&utm_medium=social&utm_source=github&target=https%3A%2F%2Fgithub.com%2Fohmyzsh%2Fohmyzsh)
|
[](https://huntr.dev/bounties/disclose/?utm_campaign=ohmyzsh%2Fohmyzsh&utm_medium=social&utm_source=github&target=https%3A%2F%2Fgithub.com%2Fohmyzsh%2Fohmyzsh)
|
||||||
@ -58,9 +59,21 @@ To learn more, visit [ohmyz.sh](https://ohmyz.sh), follow [@ohmyzsh](https://twi
|
|||||||
|
|
||||||
## Getting Started
|
## Getting Started
|
||||||
|
|
||||||
|
### Operating System Compatibility
|
||||||
|
|
||||||
|
| O/S | Status |
|
||||||
|
| :---------------- | :------: |
|
||||||
|
| Android | ✅ |
|
||||||
|
| FreeBSD | ✅ |
|
||||||
|
| LCARS | 🛸 |
|
||||||
|
| Linux | ✅ |
|
||||||
|
| MacOS | ✅ |
|
||||||
|
| OS/2 Warp | ❌ |
|
||||||
|
| Windows (WSL2) | ✅ |
|
||||||
|
|
||||||
|
|
||||||
### Prerequisites
|
### Prerequisites
|
||||||
|
|
||||||
- A Unix-like operating system: macOS, Linux, BSD. On Windows: WSL2 is preferred, but cygwin or msys also mostly work.
|
|
||||||
- [Zsh](https://www.zsh.org) should be installed (v4.3.9 or more recent is fine but we prefer 5.0.8 and newer). If not pre-installed (run `zsh --version` to confirm), check the following wiki instructions here: [Installing ZSH](https://github.com/ohmyzsh/ohmyzsh/wiki/Installing-ZSH)
|
- [Zsh](https://www.zsh.org) should be installed (v4.3.9 or more recent is fine but we prefer 5.0.8 and newer). If not pre-installed (run `zsh --version` to confirm), check the following wiki instructions here: [Installing ZSH](https://github.com/ohmyzsh/ohmyzsh/wiki/Installing-ZSH)
|
||||||
- `curl` or `wget` should be installed
|
- `curl` or `wget` should be installed
|
||||||
- `git` should be installed (recommended v2.4.11 or higher)
|
- `git` should be installed (recommended v2.4.11 or higher)
|
||||||
|
|||||||
30
plugins/rtx/README.md
Normal file
30
plugins/rtx/README.md
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
## rtx
|
||||||
|
|
||||||
|
|
||||||
|
Adds integration with [rtx](https://github.com/jdx/rtx), a runtime executor compatible with npm, nodenv, pyenv, etc. rtx is written in rust and is very fast. 20x-200x faster than asdf. With that being said, rtx is compatible with asdf plugins and .tool-versions files. It can be used as a drop-in replacement.
|
||||||
|
|
||||||
|
### Installation
|
||||||
|
|
||||||
|
1. [Download & install rtx](https://github.com/jdx/rtx#installation) by running the following:
|
||||||
|
|
||||||
|
```
|
||||||
|
curl https://rtx.pub/install.sh | sh
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
2. [Enable rtx](https://github.com/jdx/rtx#quickstart) by adding it to your `plugins` definition in `~/.zshrc`.
|
||||||
|
|
||||||
|
```
|
||||||
|
plugins=(rtx)
|
||||||
|
```
|
||||||
|
|
||||||
|
### Usage
|
||||||
|
|
||||||
|
See the [rtx readme](https://github.com/jdx/rtx#table-of-contents) for information on how to use rtx. Here are a few examples:
|
||||||
|
|
||||||
|
```
|
||||||
|
rtx install node Install the current version specified in .tool-versions/.rtx.toml
|
||||||
|
rtx use -g node@system Use system node as global default
|
||||||
|
rtx install node@20.0.0 Install a specific version number
|
||||||
|
rtx use -g node@20 Use node-20.x as global default
|
||||||
|
```
|
||||||
30
plugins/rtx/rtx.plugin.zsh
Normal file
30
plugins/rtx/rtx.plugin.zsh
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
# Find where rtx should be installed
|
||||||
|
RTX_DIR="${RTX_DIR:-$HOME/.rtx}"
|
||||||
|
RTX_COMPLETIONS="$RTX_DIR/completions"
|
||||||
|
|
||||||
|
if [[ ! -f "$RTX_DIR/rtx.sh" || ! -f "$RTX_COMPLETIONS/_rtx" ]]; then
|
||||||
|
# If not found, check for archlinux/AUR package (/opt/rtx-vm/)
|
||||||
|
if [[ -f "/opt/rtx-vm/rtx.sh" ]]; then
|
||||||
|
RTX_DIR="/opt/rtx-vm"
|
||||||
|
RTX_COMPLETIONS="$RTX_DIR"
|
||||||
|
# If not found, check for Homebrew package
|
||||||
|
elif (( $+commands[brew] )); then
|
||||||
|
_RTX_PREFIX="$(brew --prefix rtx)"
|
||||||
|
RTX_DIR="${_RTX_PREFIX}/libexec"
|
||||||
|
RTX_COMPLETIONS="${_RTX_PREFIX}/share/zsh/site-functions"
|
||||||
|
unset _RTX_PREFIX
|
||||||
|
else
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Load command
|
||||||
|
if [[ -f "$RTX_DIR/rtx.sh" ]]; then
|
||||||
|
source "$RTX_DIR/rtx.sh"
|
||||||
|
# Load completions
|
||||||
|
if [[ -f "$RTX_COMPLETIONS/_rtx" ]]; then
|
||||||
|
fpath+=("$RTX_COMPLETIONS")
|
||||||
|
autoload -Uz _rtx
|
||||||
|
compdef _rtx rtx # compdef is already loaded before loading plugins
|
||||||
|
fi
|
||||||
|
fi
|
||||||
Loading…
Reference in New Issue
Block a user