1
0
mirror of https://github.com/ohmyzsh/ohmyzsh.git synced 2026-02-12 05:49:47 +08:00

Compare commits

...

4 Commits

Author SHA1 Message Date
Marc Cornellà
b75b01a309
chore: update README badges 2023-10-08 20:01:46 +02:00
DemonKiller
7105e37ef0
feat(rtx) Added new polyglot runtime manager (asdf rust clone) (#11932)
* add readme.md for rtx
* add rtx plugin
* update install info
* remove redundant slashes
2023-10-08 15:27:55 +02:00
Robby Russell
ee857e3acf
Adding operating system compatibility chart 2023-10-08 14:05:03 +02:00
Robby Russell
974055f638
Adding Mastadon and updating X badge 2023-10-08 13:47:16 +02:00
3 changed files with 75 additions and 2 deletions

View File

@ -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).
[![CI](https://github.com/ohmyzsh/ohmyzsh/workflows/CI/badge.svg)](https://github.com/ohmyzsh/ohmyzsh/actions?query=workflow%3ACI) [![CI](https://github.com/ohmyzsh/ohmyzsh/workflows/CI/badge.svg)](https://github.com/ohmyzsh/ohmyzsh/actions?query=workflow%3ACI)
[![Follow @ohmyzsh](https://img.shields.io/twitter/follow/ohmyzsh?label=Follow+@ohmyzsh&style=flat)](https://twitter.com/intent/follow?screen_name=ohmyzsh) [![X (formerly Twitter) Follow](https://img.shields.io/twitter/follow/ohmyzsh?label=%40ohmyzsh&logo=x&style=flat)](https://twitter.com/intent/follow?screen_name=ohmyzsh)
[![Mastodon Follow](https://img.shields.io/mastodon/follow/111169632522566717?label=%40ohmyzsh&domain=https%3A%2F%2Fmstdn.social&logo=mastodon&style=flat)](https://mstdn.social/@ohmyzsh)
[![Discord server](https://img.shields.io/discord/642496866407284746)](https://discord.gg/ohmyzsh) [![Discord server](https://img.shields.io/discord/642496866407284746)](https://discord.gg/ohmyzsh)
[![Gitpod ready](https://img.shields.io/badge/Gitpod-ready-blue?logo=gitpod)](https://gitpod.io/#https://github.com/ohmyzsh/ohmyzsh) [![Gitpod ready](https://img.shields.io/badge/Gitpod-ready-blue?logo=gitpod)](https://gitpod.io/#https://github.com/ohmyzsh/ohmyzsh)
[![huntr.dev](https://cdn.huntr.dev/huntr_security_badge_mono.svg)](https://huntr.dev/bounties/disclose/?utm_campaign=ohmyzsh%2Fohmyzsh&utm_medium=social&utm_source=github&target=https%3A%2F%2Fgithub.com%2Fohmyzsh%2Fohmyzsh) [![huntr.dev](https://cdn.huntr.dev/huntr_security_badge_mono.svg)](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
View 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
```

View 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