mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2025-12-12 15:34:50 +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:
|
||||
|
||||
help Print this help message
|
||||
pr <command> Commands for Oh My Zsh Pull Requests management
|
||||
theme <command> Commands for Oh My Zsh themes management
|
||||
plugin <command> Manage plugins
|
||||
pr <command> Manage Oh My Zsh Pull Requests
|
||||
theme <command> Manage themes
|
||||
update Update Oh My Zsh
|
||||
|
||||
EOF
|
||||
@ -134,18 +135,20 @@ 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}
|
||||
} | fmt -w $COLUMNS
|
||||
{
|
||||
(( ${#custom_plugins} )) && {
|
||||
print -Pn "%U%BCustom plugins%b%u: "
|
||||
print -l ${(q-)custom_plugins}
|
||||
}
|
||||
|
||||
(( ${#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
|
||||
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
|
||||
}
|
||||
|
||||
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"/:::))
|
||||
builtin_themes=("$ZSH"/themes/*.zsh-theme(.N:t:r))
|
||||
|
||||
(( ${#custom_themes} )) && {
|
||||
print -Pn "%U%BCustom themes%b%u: "
|
||||
print -l ${(q-)custom_themes}
|
||||
} | fmt -w $COLUMNS
|
||||
{
|
||||
(( ${#custom_themes} )) && {
|
||||
print -Pn "%U%BCustom themes%b%u: "
|
||||
print -l ${(q-)custom_themes}
|
||||
}
|
||||
|
||||
(( ${#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
|
||||
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
|
||||
}
|
||||
|
||||
function _omz::theme::use {
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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_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
|
||||
|
||||
@ -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`.
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
## Installing
|
||||
|
||||
### MacOS
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user