1
0
mirror of https://github.com/ohmyzsh/ohmyzsh.git synced 2026-01-19 00:37:35 +08:00

Compare commits

..

No commits in common. "fd512077018353faefd51036239bdba12981b40f" and "4cd5f7f9202bd062871662836ea837c9abea6e5d" have entirely different histories.

5 changed files with 33 additions and 29 deletions

View File

@ -60,9 +60,8 @@ Usage: omz <command> [options]
Available commands:
help Print this help message
plugin <command> Manage plugins
pr <command> Manage Oh My Zsh Pull Requests
theme <command> Manage themes
pr <command> Commands for Oh My Zsh Pull Requests management
theme <command> Commands for Oh My Zsh themes management
update Update Oh My Zsh
EOF
@ -135,20 +134,18 @@ function _omz::plugin::list {
custom_plugins=("$ZSH_CUSTOM"/plugins/*(/N:t))
builtin_plugins=("$ZSH"/plugins/*(/N:t))
{
(( ${#custom_plugins} )) && {
print -Pn "%U%BCustom plugins%b%u: "
print -l ${(q-)custom_plugins}
}
(( ${#custom_plugins} )) && {
print -Pn "%U%BCustom plugins%b%u: "
print -l ${(q-)custom_plugins}
} | fmt -w $COLUMNS
(( ${#builtin_plugins} )) && {
# add a line of separation
(( ${#custom_plugins} )) && echo
(( ${#builtin_plugins} )) && {
# add a line of separation
(( ${#custom_plugins} )) && echo
print -Pn "%U%BBuilt-in plugins%b%u: "
print -l ${(q-)builtin_plugins}
}
} | fmt -w $COLUMNS | sed -E $'s/\e?(\\[[0-9]*m)/\e\\1/g' # deal with fmt removing ESC
print -Pn "%U%BBuilt-in plugins%b%u: "
print -l ${(q-)builtin_plugins}
} | fmt -w $COLUMNS
}
function _omz::pr {
@ -308,20 +305,18 @@ function _omz::theme::list {
custom_themes=("$ZSH_CUSTOM"/**/*.zsh-theme(.N:r:gs:"$ZSH_CUSTOM"/themes/:::gs:"$ZSH_CUSTOM"/:::))
builtin_themes=("$ZSH"/themes/*.zsh-theme(.N:t:r))
{
(( ${#custom_themes} )) && {
print -Pn "%U%BCustom themes%b%u: "
print -l ${(q-)custom_themes}
}
(( ${#custom_themes} )) && {
print -Pn "%U%BCustom themes%b%u: "
print -l ${(q-)custom_themes}
} | fmt -w $COLUMNS
(( ${#builtin_themes} )) && {
# add a line of separation
(( ${#custom_themes} )) && echo
(( ${#builtin_themes} )) && {
# add a line of separation
(( ${#custom_themes} )) && echo
print -Pn "%U%BBuilt-in themes%b%u: "
print -l ${(q-)builtin_themes}
}
} | fmt -w $COLUMNS | sed -E $'s/\e?(\\[[0-9]*m)/\e\\1/g' # deal with fmt removing ESC
print -Pn "%U%BBuilt-in themes%b%u: "
print -l ${(q-)builtin_themes}
} | fmt -w $COLUMNS
}
function _omz::theme::use {

View File

@ -226,7 +226,7 @@ function git_prompt_status() {
# For each status prefix, do a regex comparison
for status_prefix in ${(k)prefix_constant_map}; do
local status_constant="${prefix_constant_map[$status_prefix]}"
local status_regex=$'(^|\n)'"$status_prefix"
local status_regex="(^|\n)$status_prefix"
if [[ "$status_text" =~ $status_regex ]]; then
statuses_seen[$status_constant]=1

View File

@ -36,3 +36,4 @@ setopt hist_expire_dups_first # delete duplicates first when HISTFILE size excee
setopt hist_ignore_dups # ignore duplicated commands history list
setopt hist_ignore_space # ignore commands that start with space
setopt hist_verify # show command with history expansion to user before running it
setopt share_history # share command history data

View File

@ -6,6 +6,14 @@ configured on `kubectl` to your Bash/Zsh prompt strings (i.e. the `$PS1`).
Inspired by several tools used to simplify usage of `kubectl`.
![prompt](img/screenshot2.png)
![prompt_sol_light](img/screenshot-sol-light.png)
![prompt_img](img/screenshot-img.png)
![prompt demo](img/kube-ps1.gif)
## Installing
### MacOS

View File

@ -131,7 +131,7 @@ prompt_git() {
zstyle ':vcs_info:*' get-revision true
zstyle ':vcs_info:*' check-for-changes true
zstyle ':vcs_info:*' stagedstr '✚'
zstyle ':vcs_info:*' unstagedstr '±'
zstyle ':vcs_info:*' unstagedstr ''
zstyle ':vcs_info:*' formats ' %u%c'
zstyle ':vcs_info:*' actionformats ' %u%c'
vcs_info