fix(zellij): change default prefix from z to zj

Avoid conflicts with popular directory jumpers (zoxide, z.lua, etc.)
by defaulting to "zj". Users can opt into "z" via ZSH_ZELLIJ_PREFIX_Z.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Hobeom 2026-03-09 21:00:38 +09:00
commit 6b292d300e
2 changed files with 24 additions and 18 deletions

View file

@ -9,23 +9,29 @@ plugins=(... zellij)
## Dynamic prefix
The default alias prefix is `z`. If `z` is already taken by another plugin (e.g., the
[suse](https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/suse) plugin), the prefix
automatically falls back to `zj`.
The default alias prefix is `zj`. To use the shorter `z` prefix instead, set the following
variable before oh-my-zsh is sourced:
```zsh
ZSH_ZELLIJ_PREFIX_Z=true
```
> **Note:** If `z` is already aliased by another plugin (e.g., zoxide), the prefix stays `zj`
> even when `ZSH_ZELLIJ_PREFIX_Z` is set.
## Aliases
| Alias | Command | Description |
| ---------- | ---------------------------- | ------------------------ |
| `z`/`zj` | `zellij` | Zellij command |
| `za`/`zja` | `zellij attach` | Attach to a session |
| `zd`/`zjd` | `zellij delete-session` | Delete a session |
| `zda`/`zjda` | `zellij delete-all-sessions` | Delete all sessions |
| `zk`/`zjk` | `zellij kill-session` | Kill a session |
| `zka`/`zjka` | `zellij kill-all-sessions` | Kill all sessions |
| `zl`/`zjl` | `zellij list-sessions` | List sessions |
| `zr`/`zjr` | `zellij run` | Run a command in a pane |
| `zs`/`zjs` | `zellij -s` | Start a named session |
| Alias (default) | Alias (with `z`) | Command | Description |
| ---------------- | ---------------- | ---------------------------- | ------------------------ |
| `zj` | `z` | `zellij` | Zellij command |
| `zja` | `za` | `zellij attach` | Attach to a session |
| `zjd` | `zd` | `zellij delete-session` | Delete a session |
| `zjda` | `zda` | `zellij delete-all-sessions` | Delete all sessions |
| `zjk` | `zk` | `zellij kill-session` | Kill a session |
| `zjka` | `zka` | `zellij kill-all-sessions` | Kill all sessions |
| `zjl` | `zl` | `zellij list-sessions` | List sessions |
| `zjr` | `zr` | `zellij run` | Run a command in a pane |
| `zjs` | `zs` | `zellij -s` | Start a named session |
## Completions

View file

@ -2,11 +2,11 @@ if (( ! $+commands[zellij] )); then
return
fi
# Dynamic prefix: use "z" if no conflict, fall back to "zj"
if (( $+aliases[z] )); then
_zellij_prefix="zj"
else
# Dynamic prefix: use "zj" by default, use "z" if ZSH_ZELLIJ_PREFIX_Z is set and "z" is available
if [[ -n "$ZSH_ZELLIJ_PREFIX_Z" ]] && (( ! $+aliases[z] )); then
_zellij_prefix="z"
else
_zellij_prefix="zj"
fi
# Aliases