mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-01-24 01:37:27 +08:00
Compare commits
7 Commits
4cd5f7f920
...
fd51207701
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fd51207701 | ||
|
|
c66d8a841d | ||
|
|
6e7b861675 | ||
|
|
2376022890 | ||
|
|
75ae0e905f | ||
|
|
982d010be5 | ||
|
|
2d97e102b2 |
49
lib/cli.zsh
49
lib/cli.zsh
@ -60,8 +60,9 @@ Usage: omz <command> [options]
|
|||||||
Available commands:
|
Available commands:
|
||||||
|
|
||||||
help Print this help message
|
help Print this help message
|
||||||
pr <command> Commands for Oh My Zsh Pull Requests management
|
plugin <command> Manage plugins
|
||||||
theme <command> Commands for Oh My Zsh themes management
|
pr <command> Manage Oh My Zsh Pull Requests
|
||||||
|
theme <command> Manage themes
|
||||||
update Update Oh My Zsh
|
update Update Oh My Zsh
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
@ -134,18 +135,20 @@ function _omz::plugin::list {
|
|||||||
custom_plugins=("$ZSH_CUSTOM"/plugins/*(/N:t))
|
custom_plugins=("$ZSH_CUSTOM"/plugins/*(/N:t))
|
||||||
builtin_plugins=("$ZSH"/plugins/*(/N:t))
|
builtin_plugins=("$ZSH"/plugins/*(/N:t))
|
||||||
|
|
||||||
(( ${#custom_plugins} )) && {
|
{
|
||||||
print -Pn "%U%BCustom plugins%b%u: "
|
(( ${#custom_plugins} )) && {
|
||||||
print -l ${(q-)custom_plugins}
|
print -Pn "%U%BCustom plugins%b%u: "
|
||||||
} | fmt -w $COLUMNS
|
print -l ${(q-)custom_plugins}
|
||||||
|
}
|
||||||
|
|
||||||
(( ${#builtin_plugins} )) && {
|
(( ${#builtin_plugins} )) && {
|
||||||
# add a line of separation
|
# add a line of separation
|
||||||
(( ${#custom_plugins} )) && echo
|
(( ${#custom_plugins} )) && echo
|
||||||
|
|
||||||
print -Pn "%U%BBuilt-in plugins%b%u: "
|
print -Pn "%U%BBuilt-in plugins%b%u: "
|
||||||
print -l ${(q-)builtin_plugins}
|
print -l ${(q-)builtin_plugins}
|
||||||
} | fmt -w $COLUMNS
|
}
|
||||||
|
} | fmt -w $COLUMNS | sed -E $'s/\e?(\\[[0-9]*m)/\e\\1/g' # deal with fmt removing ESC
|
||||||
}
|
}
|
||||||
|
|
||||||
function _omz::pr {
|
function _omz::pr {
|
||||||
@ -305,18 +308,20 @@ function _omz::theme::list {
|
|||||||
custom_themes=("$ZSH_CUSTOM"/**/*.zsh-theme(.N:r:gs:"$ZSH_CUSTOM"/themes/:::gs:"$ZSH_CUSTOM"/:::))
|
custom_themes=("$ZSH_CUSTOM"/**/*.zsh-theme(.N:r:gs:"$ZSH_CUSTOM"/themes/:::gs:"$ZSH_CUSTOM"/:::))
|
||||||
builtin_themes=("$ZSH"/themes/*.zsh-theme(.N:t:r))
|
builtin_themes=("$ZSH"/themes/*.zsh-theme(.N:t:r))
|
||||||
|
|
||||||
(( ${#custom_themes} )) && {
|
{
|
||||||
print -Pn "%U%BCustom themes%b%u: "
|
(( ${#custom_themes} )) && {
|
||||||
print -l ${(q-)custom_themes}
|
print -Pn "%U%BCustom themes%b%u: "
|
||||||
} | fmt -w $COLUMNS
|
print -l ${(q-)custom_themes}
|
||||||
|
}
|
||||||
|
|
||||||
(( ${#builtin_themes} )) && {
|
(( ${#builtin_themes} )) && {
|
||||||
# add a line of separation
|
# add a line of separation
|
||||||
(( ${#custom_themes} )) && echo
|
(( ${#custom_themes} )) && echo
|
||||||
|
|
||||||
print -Pn "%U%BBuilt-in themes%b%u: "
|
print -Pn "%U%BBuilt-in themes%b%u: "
|
||||||
print -l ${(q-)builtin_themes}
|
print -l ${(q-)builtin_themes}
|
||||||
} | fmt -w $COLUMNS
|
}
|
||||||
|
} | fmt -w $COLUMNS | sed -E $'s/\e?(\\[[0-9]*m)/\e\\1/g' # deal with fmt removing ESC
|
||||||
}
|
}
|
||||||
|
|
||||||
function _omz::theme::use {
|
function _omz::theme::use {
|
||||||
|
|||||||
@ -226,7 +226,7 @@ function git_prompt_status() {
|
|||||||
# For each status prefix, do a regex comparison
|
# For each status prefix, do a regex comparison
|
||||||
for status_prefix in ${(k)prefix_constant_map}; do
|
for status_prefix in ${(k)prefix_constant_map}; do
|
||||||
local status_constant="${prefix_constant_map[$status_prefix]}"
|
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
|
if [[ "$status_text" =~ $status_regex ]]; then
|
||||||
statuses_seen[$status_constant]=1
|
statuses_seen[$status_constant]=1
|
||||||
|
|||||||
@ -36,4 +36,3 @@ setopt hist_expire_dups_first # delete duplicates first when HISTFILE size excee
|
|||||||
setopt hist_ignore_dups # ignore duplicated commands history list
|
setopt hist_ignore_dups # ignore duplicated commands history list
|
||||||
setopt hist_ignore_space # ignore commands that start with space
|
setopt hist_ignore_space # ignore commands that start with space
|
||||||
setopt hist_verify # show command with history expansion to user before running it
|
setopt hist_verify # show command with history expansion to user before running it
|
||||||
setopt share_history # share command history data
|
|
||||||
|
|||||||
@ -6,14 +6,6 @@ configured on `kubectl` to your Bash/Zsh prompt strings (i.e. the `$PS1`).
|
|||||||
|
|
||||||
Inspired by several tools used to simplify usage of `kubectl`.
|
Inspired by several tools used to simplify usage of `kubectl`.
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
## Installing
|
## Installing
|
||||||
|
|
||||||
### MacOS
|
### MacOS
|
||||||
|
|||||||
@ -131,7 +131,7 @@ prompt_git() {
|
|||||||
zstyle ':vcs_info:*' get-revision true
|
zstyle ':vcs_info:*' get-revision true
|
||||||
zstyle ':vcs_info:*' check-for-changes true
|
zstyle ':vcs_info:*' check-for-changes true
|
||||||
zstyle ':vcs_info:*' stagedstr '✚'
|
zstyle ':vcs_info:*' stagedstr '✚'
|
||||||
zstyle ':vcs_info:*' unstagedstr '●'
|
zstyle ':vcs_info:*' unstagedstr '±'
|
||||||
zstyle ':vcs_info:*' formats ' %u%c'
|
zstyle ':vcs_info:*' formats ' %u%c'
|
||||||
zstyle ':vcs_info:*' actionformats ' %u%c'
|
zstyle ':vcs_info:*' actionformats ' %u%c'
|
||||||
vcs_info
|
vcs_info
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user