mirror of
https://github.com/robbyrussell/oh-my-zsh.git
synced 2026-09-27 05:26:06 +02:00
Compare commits
6
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e8b1cca662 | ||
|
|
8e5f198226 | ||
|
|
391cafc4cf | ||
|
|
3079e2f0b5 | ||
|
|
129de5a05f | ||
|
|
bd77419b2a |
+10
-4
@@ -14,10 +14,16 @@ FX=(
|
|||||||
reverse "%{[07m%}" no-reverse "%{[27m%}"
|
reverse "%{[07m%}" no-reverse "%{[27m%}"
|
||||||
)
|
)
|
||||||
|
|
||||||
for color in {000..255}; do
|
# Build the tables with array operations instead of a 256-iteration loop
|
||||||
FG[$color]="%{[38;5;${color}m%}"
|
() {
|
||||||
BG[$color]="%{[48;5;${color}m%}"
|
setopt localoptions noksharrays
|
||||||
done
|
local -a codes fg bg
|
||||||
|
codes=({000..255})
|
||||||
|
fg=( "%{"$'\e'"[38;5;"${^codes}"m%}" )
|
||||||
|
bg=( "%{"$'\e'"[48;5;"${^codes}"m%}" )
|
||||||
|
FG=( ${codes:^fg} )
|
||||||
|
BG=( ${codes:^bg} )
|
||||||
|
}
|
||||||
|
|
||||||
# Show all 256 colors with color number
|
# Show all 256 colors with color number
|
||||||
function spectrum_ls() {
|
function spectrum_ls() {
|
||||||
|
|||||||
+6
-1
@@ -31,7 +31,12 @@ function title {
|
|||||||
else
|
else
|
||||||
# Try to use terminfo to set the title if the feature is available
|
# Try to use terminfo to set the title if the feature is available
|
||||||
if (( ${+terminfo[fsl]} && ${+terminfo[tsl]} )); then
|
if (( ${+terminfo[fsl]} && ${+terminfo[tsl]} )); then
|
||||||
print -Pn "${terminfo[tsl]}$1${terminfo[fsl]}"
|
# Emit the capabilities with echoti so terminfo does its own parameter
|
||||||
|
# substitution: some terminals (vt320) take a column argument, and
|
||||||
|
# running prompt expansion over the capability string mangles it.
|
||||||
|
echoti tsl 0
|
||||||
|
print -Pn "$1"
|
||||||
|
echoti fsl
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
|||||||
@@ -130,7 +130,7 @@ plugins=(... kubectl)
|
|||||||
| kdss | `kubectl describe statefulset` | Describe statefulset resource in detail |
|
| kdss | `kubectl describe statefulset` | Describe statefulset resource in detail |
|
||||||
| kdelss | `kubectl delete statefulset` | Delete the statefulset |
|
| kdelss | `kubectl delete statefulset` | Delete the statefulset |
|
||||||
| ksss | `kubectl scale statefulset` | Scale a statefulset |
|
| ksss | `kubectl scale statefulset` | Scale a statefulset |
|
||||||
| krsss | `kubectl rollout status statefulset` | Check the rollout status of a deployment |
|
| krsss | `kubectl rollout status statefulset` | Check the rollout status of a statefulset |
|
||||||
| krrss | `kubectl rollout restart statefulset` | Rollout restart a statefulset |
|
| krrss | `kubectl rollout restart statefulset` | Rollout restart a statefulset |
|
||||||
| | | **Service Accounts management** |
|
| | | **Service Accounts management** |
|
||||||
| kdsa | `kubectl describe sa` | Describe a service account in details |
|
| kdsa | `kubectl describe sa` | Describe a service account in details |
|
||||||
|
|||||||
@@ -45,6 +45,7 @@ plugins=(... systemd)
|
|||||||
| `sc-set-environment` | `sudo systemctl set-environment` | Set one or more systemd manager environment variables |
|
| `sc-set-environment` | `sudo systemctl set-environment` | Set one or more systemd manager environment variables |
|
||||||
| `sc-unset-environment` | `sudo systemctl unset-environment` | Unset one or more systemd manager environment variables |
|
| `sc-unset-environment` | `sudo systemctl unset-environment` | Unset one or more systemd manager environment variables |
|
||||||
| `sc-edit` | `sudo systemctl edit` | Edit a drop-in snippet or a whole replacement file with `--full` |
|
| `sc-edit` | `sudo systemctl edit` | Edit a drop-in snippet or a whole replacement file with `--full` |
|
||||||
|
| `sc-edit-full` | `sudo systemctl edit --full` | Edit the whole unit file instead of a drop-in snippet |
|
||||||
| `sc-enable-now` | `sudo systemctl enable --now` | Enable and start unit(s) |
|
| `sc-enable-now` | `sudo systemctl enable --now` | Enable and start unit(s) |
|
||||||
| `sc-disable-now` | `sudo systemctl disable --now` | Disable and stop unit(s) |
|
| `sc-disable-now` | `sudo systemctl disable --now` | Disable and stop unit(s) |
|
||||||
| `sc-mask-now` | `sudo systemctl mask --now` | Mask and stop unit(s) |
|
| `sc-mask-now` | `sudo systemctl mask --now` | Mask and stop unit(s) |
|
||||||
|
|||||||
@@ -97,6 +97,10 @@ alias scu-mask-now="scu-mask --now"
|
|||||||
alias scu-failed='systemctl --user --failed'
|
alias scu-failed='systemctl --user --failed'
|
||||||
alias sc-failed='systemctl --failed'
|
alias sc-failed='systemctl --failed'
|
||||||
|
|
||||||
|
# --full commands
|
||||||
|
alias sc-edit-full="sc-edit --full"
|
||||||
|
alias scu-edit-full="scu-edit --full"
|
||||||
|
|
||||||
function systemd_prompt_info {
|
function systemd_prompt_info {
|
||||||
local unit
|
local unit
|
||||||
for unit in "$@"; do
|
for unit in "$@"; do
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ if [[ ! $DISABLE_VENV_CD -eq 1 ]]; then
|
|||||||
# Get absolute path, resolving symlinks
|
# Get absolute path, resolving symlinks
|
||||||
local PROJECT_ROOT="${PWD:A}"
|
local PROJECT_ROOT="${PWD:A}"
|
||||||
while [[ "$PROJECT_ROOT" != "/" && ! -e "$PROJECT_ROOT/.venv" \
|
while [[ "$PROJECT_ROOT" != "/" && ! -e "$PROJECT_ROOT/.venv" \
|
||||||
&& ! -d "$PROJECT_ROOT/.git" ]]; do
|
&& ! -e "$PROJECT_ROOT/.git" ]]; do
|
||||||
PROJECT_ROOT="${PROJECT_ROOT:h}"
|
PROJECT_ROOT="${PROJECT_ROOT:h}"
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ function theme_precmd {
|
|||||||
if (( promptsize + rubypromptsize + pwdsize + venvpromptsize + condapromptsize > TERMWIDTH )); then
|
if (( promptsize + rubypromptsize + pwdsize + venvpromptsize + condapromptsize > TERMWIDTH )); then
|
||||||
(( PR_PWDLEN = TERMWIDTH - promptsize ))
|
(( PR_PWDLEN = TERMWIDTH - promptsize ))
|
||||||
elif [[ "${langinfo[CODESET]}" = UTF-8 ]]; then
|
elif [[ "${langinfo[CODESET]}" = UTF-8 ]]; then
|
||||||
PR_FILLBAR="\${(l:$(( TERMWIDTH - (promptsize + rubypromptsize + pwdsize + venvpromptsize + condapromptsize ) ))::${PR_HBAR}:)}"
|
PR_FILLBAR="\${(l:$(( TERMWIDTH - (promptsize + rubypromptsize + pwdsize + venvpromptsize + condapromptsize ) ))::─:)}"
|
||||||
else
|
else
|
||||||
PR_FILLBAR="${PR_SHIFT_IN}\${(l:$(( TERMWIDTH - (promptsize + rubypromptsize + pwdsize + venvpromptsize + condapromptsize ) ))::${altchar[q]:--}:)}${PR_SHIFT_OUT}"
|
PR_FILLBAR="${PR_SHIFT_IN}\${(l:$(( TERMWIDTH - (promptsize + rubypromptsize + pwdsize + venvpromptsize + condapromptsize ) ))::${altchar[q]:--}:)}${PR_SHIFT_OUT}"
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user