mirror of
https://github.com/robbyrussell/oh-my-zsh.git
synced 2026-11-26 10:23:06 +01:00
Compare commits
6
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1eebae3a3f | ||
|
|
ca5b808de8 | ||
|
|
c8aea70a11 | ||
|
|
799f9a8a8a | ||
|
|
7140fedbfa | ||
|
|
b5cb2fe952 |
No files matched your search
@@ -90,6 +90,7 @@ colorize_less() {
|
|||||||
# (e.g. when not scrolled to the bottom) while already the next file will be displayed.
|
# (e.g. when not scrolled to the bottom) while already the next file will be displayed.
|
||||||
local LESSOPEN="| zsh -c 'source \"$ZSH_COLORIZE_PLUGIN_PATH\"; \
|
local LESSOPEN="| zsh -c 'source \"$ZSH_COLORIZE_PLUGIN_PATH\"; \
|
||||||
ZSH_COLORIZE_TOOL=$ZSH_COLORIZE_TOOL ZSH_COLORIZE_STYLE=$ZSH_COLORIZE_STYLE \
|
ZSH_COLORIZE_TOOL=$ZSH_COLORIZE_TOOL ZSH_COLORIZE_STYLE=$ZSH_COLORIZE_STYLE \
|
||||||
|
ZSH_COLORIZE_CHROMA_FORMATTER=$ZSH_COLORIZE_CHROMA_FORMATTER \
|
||||||
colorize_cat %s 2> /dev/null'"
|
colorize_cat %s 2> /dev/null'"
|
||||||
|
|
||||||
# LESSCLOSE will be set to prevent any errors by executing a user script
|
# LESSCLOSE will be set to prevent any errors by executing a user script
|
||||||
|
|||||||
@@ -112,6 +112,37 @@ plugins=(... hcloud)
|
|||||||
| hcst | `hcloud server-type list` | List all server types |
|
| hcst | `hcloud server-type list` | List all server types |
|
||||||
| hcit | `hcloud image list --type system` | List all system images |
|
| hcit | `hcloud image list --type system` | List all system images |
|
||||||
|
|
||||||
|
## Prompt function
|
||||||
|
|
||||||
|
This plugin provides `hcloud_prompt_info` which can be added to your prompt to display the current Hetzner Cloud context.
|
||||||
|
|
||||||
|
- If `HCLOUD_TOKEN` environment variable is set, it displays `HCLOUD_TOKEN` (indicating direct token usage)
|
||||||
|
- Otherwise, it displays the active context name
|
||||||
|
|
||||||
|
### Usage
|
||||||
|
|
||||||
|
Add `$(hcloud_prompt_info)` to your `PROMPT` or `RPROMPT` in your `.zshrc`:
|
||||||
|
|
||||||
|
```zsh
|
||||||
|
RPROMPT='$(hcloud_prompt_info)'
|
||||||
|
```
|
||||||
|
|
||||||
|
### Theme variables
|
||||||
|
|
||||||
|
| Variable | Default | Description |
|
||||||
|
| :----------------------------- | :-------------- | :----------------------------------------------- |
|
||||||
|
| `ZSH_THEME_HCLOUD_PREFIX` | `<hcloud:` | Prefix before the context name |
|
||||||
|
| `ZSH_THEME_HCLOUD_SUFFIX` | `>` | Suffix after the context name |
|
||||||
|
| `ZSH_THEME_HCLOUD_TOKEN_TEXT` | `HCLOUD_TOKEN` | Text shown when `HCLOUD_TOKEN` env var is set |
|
||||||
|
|
||||||
|
### Example with custom styling
|
||||||
|
|
||||||
|
```zsh
|
||||||
|
ZSH_THEME_HCLOUD_PREFIX="%{$fg[blue]%}hcloud:("
|
||||||
|
ZSH_THEME_HCLOUD_SUFFIX=")%{$reset_color%}"
|
||||||
|
RPROMPT='$(hcloud_prompt_info)'
|
||||||
|
```
|
||||||
|
|
||||||
## Requirements
|
## Requirements
|
||||||
|
|
||||||
This plugin requires the [Hetzner Cloud CLI](https://github.com/hetznercloud/cli) to be installed.
|
This plugin requires the [Hetzner Cloud CLI](https://github.com/hetznercloud/cli) to be installed.
|
||||||
|
|||||||
@@ -131,3 +131,20 @@ alias hcdc='hcloud datacenter list'
|
|||||||
alias hcloc='hcloud location list'
|
alias hcloc='hcloud location list'
|
||||||
alias hcst='hcloud server-type list'
|
alias hcst='hcloud server-type list'
|
||||||
alias hcit='hcloud image list --type system'
|
alias hcit='hcloud image list --type system'
|
||||||
|
|
||||||
|
# Prompt function to display current hcloud context
|
||||||
|
# Usage: add $(hcloud_prompt_info) to your PROMPT or RPROMPT
|
||||||
|
function hcloud_prompt_info() {
|
||||||
|
# Check if HCLOUD_TOKEN is set (overrides context)
|
||||||
|
if [[ -n "$HCLOUD_TOKEN" ]]; then
|
||||||
|
echo "${ZSH_THEME_HCLOUD_PREFIX=<hcloud:}${ZSH_THEME_HCLOUD_TOKEN_TEXT=HCLOUD_TOKEN}${ZSH_THEME_HCLOUD_SUFFIX=>}"
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Get active context
|
||||||
|
local context
|
||||||
|
context=$(hcloud context active 2>/dev/null)
|
||||||
|
[[ -n "$context" ]] || return
|
||||||
|
|
||||||
|
echo "${ZSH_THEME_HCLOUD_PREFIX=<hcloud:}${context}${ZSH_THEME_HCLOUD_SUFFIX=>}"
|
||||||
|
}
|
||||||
@@ -80,3 +80,17 @@ zstyle ':omz:plugins:laravel' php 'herd php'
|
|||||||
| `paqr` | `php artisan queue:retry` |
|
| `paqr` | `php artisan queue:retry` |
|
||||||
| `paqt` | `php artisan queue:table` |
|
| `paqt` | `php artisan queue:table` |
|
||||||
| `paqw` | `php artisan queue:work` |
|
| `paqw` | `php artisan queue:work` |
|
||||||
|
|
||||||
|
## Modules
|
||||||
|
|
||||||
|
Aliases for [nWidart/laravel-modules](https://github.com/nWidart/laravel-modules).
|
||||||
|
|
||||||
|
| Alias | Description |
|
||||||
|
|:-:|:-:|
|
||||||
|
| `pamol` | `php artisan module:list` |
|
||||||
|
| `pamomk` | `php artisan module:make` |
|
||||||
|
| `pamoe` | `php artisan module:enable` |
|
||||||
|
| `pamod` | `php artisan module:disable` |
|
||||||
|
| `pamom` | `php artisan module:migrate` |
|
||||||
|
| `pamomr` | `php artisan module:migrate-rollback` |
|
||||||
|
| `pamos` | `php artisan module:seed` |
|
||||||
@@ -53,4 +53,13 @@ alias paqr="$_omz_laravel_php artisan queue:retry"
|
|||||||
alias paqt="$_omz_laravel_php artisan queue:table"
|
alias paqt="$_omz_laravel_php artisan queue:table"
|
||||||
alias paqw="$_omz_laravel_php artisan queue:work"
|
alias paqw="$_omz_laravel_php artisan queue:work"
|
||||||
|
|
||||||
|
# Modules (nWidart/laravel-modules)
|
||||||
|
alias pamol="$_omz_laravel_php artisan module:list"
|
||||||
|
alias pamomk="$_omz_laravel_php artisan module:make"
|
||||||
|
alias pamoe="$_omz_laravel_php artisan module:enable"
|
||||||
|
alias pamod="$_omz_laravel_php artisan module:disable"
|
||||||
|
alias pamom="$_omz_laravel_php artisan module:migrate"
|
||||||
|
alias pamomr="$_omz_laravel_php artisan module:migrate-rollback"
|
||||||
|
alias pamos="$_omz_laravel_php artisan module:seed"
|
||||||
|
|
||||||
unset _omz_laravel_php
|
unset _omz_laravel_php
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
# Pre-commit plugin
|
# Pre-commit plugin
|
||||||
|
|
||||||
This plugin adds aliases for common commands of [pre-commit](https://pre-commit.com/).
|
This plugin adds aliases for common commands of [pre-commit](https://pre-commit.com/).
|
||||||
It also supports [prek](https://github.com/prek/prek) as a drop-in replacement.
|
It also supports [prek](https://github.com/j178/prek) as a drop-in replacement.
|
||||||
If `prek` is available, it will be used; otherwise, `pre-commit` is used as fallback.
|
If `prek` is available, it will be used; otherwise, `pre-commit` is used as fallback.
|
||||||
|
|
||||||
To use this plugin, add it to the plugins array in your zshrc file:
|
To use this plugin, add it to the plugins array in your zshrc file:
|
||||||
|
|||||||
@@ -4,6 +4,9 @@ Initializes [zsh-patina](https://github.com/michel-kraemer/zsh-patina), a
|
|||||||
"blazingly fast Zsh plugin performing syntax highlighting of your command line
|
"blazingly fast Zsh plugin performing syntax highlighting of your command line
|
||||||
while you type 🌈"
|
while you type 🌈"
|
||||||
|
|
||||||
|
The plugin also caches completions for the `zsh-patina` command in
|
||||||
|
`$ZSH_CACHE_DIR/completions/_zsh-patina`, refreshed each time the plugin loads.
|
||||||
|
|
||||||
To use it, add `zsh-patina` to the plugins array in your `.zshrc` file:
|
To use it, add `zsh-patina` to the plugins array in your `.zshrc` file:
|
||||||
|
|
||||||
```zsh
|
```zsh
|
||||||
|
|||||||
@@ -2,6 +2,20 @@ if (( $+ZSH_HIGHLIGHT_VERSION )) || (( ${plugins[(Ie)zsh-syntax-highlighting]} )
|
|||||||
echo '[oh-my-zsh] zsh-patina conflicts with zsh-syntax-highlighting, please enable only one of them'
|
echo '[oh-my-zsh] zsh-patina conflicts with zsh-syntax-highlighting, please enable only one of them'
|
||||||
elif [[ -x ${ZSH_PATINA_BINARY:-$commands[zsh-patina]} ]]; then
|
elif [[ -x ${ZSH_PATINA_BINARY:-$commands[zsh-patina]} ]]; then
|
||||||
eval "$(${ZSH_PATINA_BINARY:-$commands[zsh-patina]} activate)"
|
eval "$(${ZSH_PATINA_BINARY:-$commands[zsh-patina]} activate)"
|
||||||
|
|
||||||
|
# If the completion file doesn't exist yet, we need to autoload it and
|
||||||
|
# bind it to `zsh-patina`. Otherwise, compinit will have already done that.
|
||||||
|
if [[ ! -f "$ZSH_CACHE_DIR/completions/_zsh-patina" ]]; then
|
||||||
|
typeset -g -A _comps
|
||||||
|
autoload -Uz _zsh-patina
|
||||||
|
_comps[zsh-patina]=_zsh-patina
|
||||||
|
fi
|
||||||
|
|
||||||
|
zmodload -F zsh/files b:zf_mv
|
||||||
|
() {
|
||||||
|
local TMPPREFIX="$ZSH_CACHE_DIR/completions/._zsh-patina"
|
||||||
|
zf_mv -f -- =( "$1" completion ) "$ZSH_CACHE_DIR/completions/_zsh-patina"
|
||||||
|
} "${ZSH_PATINA_BINARY:-$commands[zsh-patina]}" &|
|
||||||
else
|
else
|
||||||
echo '[oh-my-zsh] zsh-patina not found, please install it from https://github.com/michel-kraemer/zsh-patina'
|
echo '[oh-my-zsh] zsh-patina not found, please install it from https://github.com/michel-kraemer/zsh-patina'
|
||||||
fi
|
fi
|
||||||
Reference in new issue
Block a user