summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.github/ISSUE_TEMPLATE/bug_report.md14
-rw-r--r--.github/ISSUE_TEMPLATE/feature_request.md11
-rw-r--r--README.md24
-rw-r--r--lib/git.zsh93
-rw-r--r--lib/termsupport.zsh2
-rw-r--r--lib/theme-and-appearance.zsh2
-rw-r--r--plugins/aws/aws.plugin.zsh4
-rw-r--r--plugins/battery/README.md11
-rw-r--r--plugins/docker-compose/README.md1
-rw-r--r--plugins/docker-compose/docker-compose.plugin.zsh1
-rw-r--r--plugins/dotenv/README.md24
-rw-r--r--plugins/dotenv/dotenv.plugin.zsh12
-rw-r--r--plugins/extract/README.md1
-rw-r--r--plugins/extract/_extract2
-rw-r--r--plugins/extract/extract.plugin.zsh2
-rw-r--r--plugins/httpie/README.md6
-rw-r--r--plugins/httpie/httpie.plugin.zsh7
-rw-r--r--plugins/kubectl/README.md3
-rw-r--r--plugins/kubectl/kubectl.plugin.zsh3
-rw-r--r--plugins/mix-fast/mix-fast.plugin.zsh5
-rw-r--r--plugins/sudo/sudo.plugin.zsh29
-rw-r--r--plugins/timer/README.md1
-rw-r--r--plugins/timer/timer.plugin.zsh8
-rw-r--r--plugins/vscode/README.md32
-rw-r--r--plugins/vscode/vscode.plugin.zsh27
-rw-r--r--plugins/yarn/README.md65
-rw-r--r--plugins/yarn/yarn.plugin.zsh1
-rw-r--r--templates/zshrc.zsh-template2
-rw-r--r--themes/mlh.zsh-theme59
-rw-r--r--tools/check_for_upgrade.sh2
30 files changed, 307 insertions, 147 deletions
diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md
index 7c1cb8967..b7f5460c1 100644
--- a/.github/ISSUE_TEMPLATE/bug_report.md
+++ b/.github/ISSUE_TEMPLATE/bug_report.md
@@ -26,11 +26,21 @@ A brief description of what should happen.
If applicable, add screenshots to help explain your problem.
You can also record an asciinema session: https://asciinema.org/
+**Self Check**
+
+- Have you tried reaching out on the [Discord server](https://discord.gg/ohmyzsh)?
+ This can help cut down on filling up issues. We always have a few people
+ online that are in a variety of timezones that are willing to help you!
+
+- Also searching existing [GitHub Issues](https://github.com/ohmyzsh/ohmyzsh/issues?q=) might help you get quicker support
+
**Desktop (please complete the following information):**
+
- OS / Distro: [e.g. Arch Linux, macOS]
- - Latest ohmyzsh Update?: [e.g. Yes/No]
+ - If on Windows what version of WSL: [e.g. WSL1, WSL2]
+ - Latest ohmyzsh update?: [e.g. Yes/No]
- ZSH Version: [e.g. 5.6]
- - Terminal emulator [e.g. iTerm2]
+ - Terminal emulator: [e.g. iTerm2]
**Additional context**
Add any other context about the problem here. This can be themes, plugins, custom configs.
diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md
index 346eabaea..0a8a588db 100644
--- a/.github/ISSUE_TEMPLATE/feature_request.md
+++ b/.github/ISSUE_TEMPLATE/feature_request.md
@@ -11,16 +11,19 @@ an issue where no sections have been filled will be deleted without comment.
-->
**Is your feature request related to a particular plugin or theme? If so, specify it.**
-The name of the plugin or theme that you would like us to improve. [...]
+The name of the plugin, theme or alias that you would like us to improve. [...]
**Is your feature request related to a problem? Please describe.**
A description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
-A description of what you want to happen.
+A description of what you want to happen. [...]
**Describe alternatives you've considered**
-A description of any alternative solutions or features you've considered. This can also include other plugins or aliases.
+A description of any alternative solutions or features you've considered. This can also include other plugins or themes.
**Additional context**
-Add any other context or screenshots about the feature request here. Also if you have any PRs related to this issue that are already open that you would like us to look at.
+Add any other context, screenshots or discord conversations about the feature request here. Also if you have any PRs related to this issue that are already open that you would like us to look at.
+
+**Related Issues**
+Is there any open or closed issues that is related to this feature request? If so please link them below! [...]
diff --git a/README.md b/README.md
index 9fa0c2049..329eff178 100644
--- a/README.md
+++ b/README.md
@@ -12,7 +12,7 @@ Once installed, your terminal shell will become the talk of the town _or your mo
Finally, you'll begin to get the sort of attention that you have always felt you deserved. ...or maybe you'll use the time that you're saving to start flossing more often. ๐Ÿ˜ฌ
-To learn more, visit [ohmyz.sh](https://ohmyz.sh), follow [@ohmyzsh](https://twitter.com/ohmyzsh) on Twitter, and/or join us on Discord.
+To learn more, visit [ohmyz.sh](https://ohmyz.sh), follow [@ohmyzsh](https://twitter.com/ohmyzsh) on Twitter, and/or join us on [Discord](https://discord.gg/ohmyzsh).
[![CI](https://github.com/ohmyzsh/ohmyzsh/workflows/CI/badge.svg)](https://github.com/ohmyzsh/ohmyzsh/actions?query=workflow%3ACI)
[![Follow @ohmyzsh](https://img.shields.io/twitter/follow/ohmyzsh?label=Follow+@ohmyzsh&style=flat)](https://twitter.com/intent/follow?screen_name=ohmyzsh)
@@ -22,14 +22,14 @@ To learn more, visit [ohmyz.sh](https://ohmyz.sh), follow [@ohmyzsh](https://twi
### Prerequisites
-* A Unix-like operating system: macOS, Linux, BSD. On Windows: WSL is preferred, but cygwin or msys also mostly work.
-* [Zsh](https://www.zsh.org) should be installed (v4.3.9 or more recent). If not pre-installed (run `zsh --version` to confirm), check the following instructions here: [Installing ZSH](https://github.com/ohmyzsh/ohmyzsh/wiki/Installing-ZSH)
+* A Unix-like operating system: macOS, Linux, BSD. On Windows: WSL2 is preferred, but cygwin or msys also mostly work.
+* [Zsh](https://www.zsh.org) should be installed (v4.3.9 or more recent is fine but we prefer 5.0.8 and newer). If not pre-installed (run `zsh --version` to confirm), check the following wiki instructions here: [Installing ZSH](https://github.com/ohmyzsh/ohmyzsh/wiki/Installing-ZSH)
* `curl` or `wget` should be installed
-* `git` should be installed (recommended v1.7.2 or higher)
+* `git` should be installed (recommended v2.4.11 or higher)
### Basic Installation
-Oh My Zsh is installed by running one of the following commands in your terminal. You can install this via the command-line with either `curl` or `wget`.
+Oh My Zsh is installed by running one of the following commands in your terminal. You can install this via the command-line with either `curl` or `wget`, whichever is installed on your machine.
#### via curl
@@ -58,7 +58,7 @@ sh install.sh
### Plugins
-Oh My Zsh comes with a shitload of plugins to take advantage of. You can take a look in the [plugins](https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins) directory and/or the [wiki](https://github.com/ohmyzsh/ohmyzsh/wiki/Plugins) to see what's currently available.
+Oh My Zsh comes with a shitload of plugins for you to take advantage of. You can take a look in the [plugins](https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins) directory and/or the [wiki](https://github.com/ohmyzsh/ohmyzsh/wiki/Plugins) to see what's currently available.
#### Enabling Plugins
@@ -82,15 +82,15 @@ plugins=(
)
```
-_Note that the plugins are separated by whitespace. **Do not** use commas between them._
+_Note that the plugins are separated by whitespace (spaces, tabs, new lines...). **Do not** use commas between them or it will break._
#### Using Plugins
-Most plugins (should! we're working on this) include a __README__, which documents how to use them.
+Each plugin includes a __README__, documenting it. This README should show the aliases (if the plugin adds any) and extra goodies that are inclued in that particular plugin.
### Themes
-We'll admit it. Early in the Oh My Zsh world, we may have gotten a bit too theme happy. We have over one hundred themes now bundled. Most of them have [screenshots](https://github.com/ohmyzsh/ohmyzsh/wiki/Themes) on the wiki. Check them out!
+We'll admit it. Early in the Oh My Zsh world, we may have gotten a bit too theme happy. We have over one hundred and fifty themes now bundled. Most of them have [screenshots](https://github.com/ohmyzsh/ohmyzsh/wiki/Themes) on the wiki (We are working on updating this!). Check them out!
#### Selecting a Theme
@@ -154,7 +154,7 @@ the installer accepts (these settings are also documented at the top of the inst
#### Custom Directory
-The default location is `~/.oh-my-zsh` (hidden in your home directory)
+The default location is `~/.oh-my-zsh` (hidden in your home directory, you can access it with `cd ~/.oh-my-zsh`)
If you'd like to change the install directory with the `ZSH` environment variable, either by running
`export ZSH=/your/path` before installing, or by setting it before the end of the install pipeline
@@ -303,7 +303,9 @@ Thank you so much!
We're on the social media.
* [@ohmyzsh](https://twitter.com/ohmyzsh) on Twitter. You should follow it.
-* [Oh My Zsh](https://www.facebook.com/Oh-My-Zsh-296616263819290/) on Facebook.
+* [FaceBook](https://www.facebook.com/Oh-My-Zsh-296616263819290/) poke us.
+* [Instagram](https://www.instagram.com/_ohmyzsh/) tag us in your post showing Oh My Zsh!
+* [Discord](https://discord.gg/ohmyzsh) to chat with us!
## Merchandise
diff --git a/lib/git.zsh b/lib/git.zsh
index f7d4738ca..ffc7c01a1 100644
--- a/lib/git.zsh
+++ b/lib/git.zsh
@@ -1,9 +1,20 @@
+# The git prompt's git commands are read-only and should not interfere with
+# other processes. This environment variable is equivalent to running with `git
+# --no-optional-locks`, but falls back gracefully for older versions of git.
+# See git(1) for and git-status(1) for a description of that flag.
+#
+# We wrap in a local function instead of exporting the variable directly in
+# order to avoid interfering with manually-run git commands by the user.
+function __git_prompt_git() {
+ GIT_OPTIONAL_LOCKS=0 command git "$@"
+}
+
# Outputs current branch info in prompt format
function git_prompt_info() {
local ref
- if [[ "$(command git config --get oh-my-zsh.hide-status 2>/dev/null)" != "1" ]]; then
- ref=$(command git symbolic-ref HEAD 2> /dev/null) || \
- ref=$(command git rev-parse --short HEAD 2> /dev/null) || return 0
+ if [[ "$(__git_prompt_git config --get oh-my-zsh.hide-status 2>/dev/null)" != "1" ]]; then
+ ref=$(__git_prompt_git symbolic-ref HEAD 2> /dev/null) || \
+ ref=$(__git_prompt_git rev-parse --short HEAD 2> /dev/null) || return 0
echo "$ZSH_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/}$(parse_git_dirty)$ZSH_THEME_GIT_PROMPT_SUFFIX"
fi
}
@@ -13,7 +24,7 @@ function parse_git_dirty() {
local STATUS
local -a FLAGS
FLAGS=('--porcelain')
- if [[ "$(command git config --get oh-my-zsh.hide-dirty)" != "1" ]]; then
+ if [[ "$(__git_prompt_git config --get oh-my-zsh.hide-dirty)" != "1" ]]; then
if [[ "${DISABLE_UNTRACKED_FILES_DIRTY:-}" == "true" ]]; then
FLAGS+='--untracked-files=no'
fi
@@ -27,7 +38,7 @@ function parse_git_dirty() {
FLAGS+="--ignore-submodules=${GIT_STATUS_IGNORE_SUBMODULES:-dirty}"
;;
esac
- STATUS=$(command git status ${FLAGS} 2> /dev/null | tail -n1)
+ STATUS=$(__git_prompt_git status ${FLAGS} 2> /dev/null | tail -n1)
fi
if [[ -n $STATUS ]]; then
echo "$ZSH_THEME_GIT_PROMPT_DIRTY"
@@ -39,10 +50,10 @@ function parse_git_dirty() {
# Gets the difference between the local and remote branches
function git_remote_status() {
local remote ahead behind git_remote_status git_remote_status_detailed
- remote=${$(command git rev-parse --verify ${hook_com[branch]}@{upstream} --symbolic-full-name 2>/dev/null)/refs\/remotes\/}
+ remote=${$(__git_prompt_git rev-parse --verify ${hook_com[branch]}@{upstream} --symbolic-full-name 2>/dev/null)/refs\/remotes\/}
if [[ -n ${remote} ]]; then
- ahead=$(command git rev-list ${hook_com[branch]}@{upstream}..HEAD 2>/dev/null | wc -l)
- behind=$(command git rev-list HEAD..${hook_com[branch]}@{upstream} 2>/dev/null | wc -l)
+ ahead=$(__git_prompt_git rev-list ${hook_com[branch]}@{upstream}..HEAD 2>/dev/null | wc -l)
+ behind=$(__git_prompt_git rev-list HEAD..${hook_com[branch]}@{upstream} 2>/dev/null | wc -l)
if [[ $ahead -eq 0 ]] && [[ $behind -eq 0 ]]; then
git_remote_status="$ZSH_THEME_GIT_PROMPT_EQUAL_REMOTE"
@@ -71,11 +82,11 @@ function git_remote_status() {
# it's not a symbolic ref, but in a Git repo.
function git_current_branch() {
local ref
- ref=$(command git symbolic-ref --quiet HEAD 2> /dev/null)
+ ref=$(__git_prompt_git symbolic-ref --quiet HEAD 2> /dev/null)
local ret=$?
if [[ $ret != 0 ]]; then
[[ $ret == 128 ]] && return # no git repo.
- ref=$(command git rev-parse --short HEAD 2> /dev/null) || return
+ ref=$(__git_prompt_git rev-parse --short HEAD 2> /dev/null) || return
fi
echo ${ref#refs/heads/}
}
@@ -83,8 +94,8 @@ function git_current_branch() {
# Gets the number of commits ahead from remote
function git_commits_ahead() {
- if command git rev-parse --git-dir &>/dev/null; then
- local commits="$(git rev-list --count @{upstream}..HEAD 2>/dev/null)"
+ if __git_prompt_git rev-parse --git-dir &>/dev/null; then
+ local commits="$(__git_prompt_git rev-list --count @{upstream}..HEAD 2>/dev/null)"
if [[ -n "$commits" && "$commits" != 0 ]]; then
echo "$ZSH_THEME_GIT_COMMITS_AHEAD_PREFIX$commits$ZSH_THEME_GIT_COMMITS_AHEAD_SUFFIX"
fi
@@ -93,8 +104,8 @@ function git_commits_ahead() {
# Gets the number of commits behind remote
function git_commits_behind() {
- if command git rev-parse --git-dir &>/dev/null; then
- local commits="$(git rev-list --count HEAD..@{upstream} 2>/dev/null)"
+ if __git_prompt_git rev-parse --git-dir &>/dev/null; then
+ local commits="$(__git_prompt_git rev-list --count HEAD..@{upstream} 2>/dev/null)"
if [[ -n "$commits" && "$commits" != 0 ]]; then
echo "$ZSH_THEME_GIT_COMMITS_BEHIND_PREFIX$commits$ZSH_THEME_GIT_COMMITS_BEHIND_SUFFIX"
fi
@@ -103,21 +114,21 @@ function git_commits_behind() {
# Outputs if current branch is ahead of remote
function git_prompt_ahead() {
- if [[ -n "$(command git rev-list origin/$(git_current_branch)..HEAD 2> /dev/null)" ]]; then
+ if [[ -n "$(__git_prompt_git rev-list origin/$(git_current_branch)..HEAD 2> /dev/null)" ]]; then
echo "$ZSH_THEME_GIT_PROMPT_AHEAD"
fi
}
# Outputs if current branch is behind remote
function git_prompt_behind() {
- if [[ -n "$(command git rev-list HEAD..origin/$(git_current_branch) 2> /dev/null)" ]]; then
+ if [[ -n "$(__git_prompt_git rev-list HEAD..origin/$(git_current_branch) 2> /dev/null)" ]]; then
echo "$ZSH_THEME_GIT_PROMPT_BEHIND"
fi
}
# Outputs if current branch exists on remote or not
function git_prompt_remote() {
- if [[ -n "$(command git show-ref origin/$(git_current_branch) 2> /dev/null)" ]]; then
+ if [[ -n "$(__git_prompt_git show-ref origin/$(git_current_branch) 2> /dev/null)" ]]; then
echo "$ZSH_THEME_GIT_PROMPT_REMOTE_EXISTS"
else
echo "$ZSH_THEME_GIT_PROMPT_REMOTE_MISSING"
@@ -127,62 +138,50 @@ function git_prompt_remote() {
# Formats prompt string for current git commit short SHA
function git_prompt_short_sha() {
local SHA
- SHA=$(command git rev-parse --short HEAD 2> /dev/null) && echo "$ZSH_THEME_GIT_PROMPT_SHA_BEFORE$SHA$ZSH_THEME_GIT_PROMPT_SHA_AFTER"
+ SHA=$(__git_prompt_git rev-parse --short HEAD 2> /dev/null) && echo "$ZSH_THEME_GIT_PROMPT_SHA_BEFORE$SHA$ZSH_THEME_GIT_PROMPT_SHA_AFTER"
}
# Formats prompt string for current git commit long SHA
function git_prompt_long_sha() {
local SHA
- SHA=$(command git rev-parse HEAD 2> /dev/null) && echo "$ZSH_THEME_GIT_PROMPT_SHA_BEFORE$SHA$ZSH_THEME_GIT_PROMPT_SHA_AFTER"
+ SHA=$(__git_prompt_git rev-parse HEAD 2> /dev/null) && echo "$ZSH_THEME_GIT_PROMPT_SHA_BEFORE$SHA$ZSH_THEME_GIT_PROMPT_SHA_AFTER"
}
# Get the status of the working tree
function git_prompt_status() {
+ emulate -L zsh
+
local INDEX STATUS
- INDEX=$(command git status --porcelain -b 2> /dev/null)
+ INDEX=$(__git_prompt_git status --porcelain -b 2> /dev/null) || return 0
STATUS=""
- if $(echo "$INDEX" | command grep -E '^\?\? ' &> /dev/null); then
+ if [[ "${INDEX}" =~ $'(^|\n)\\?\\? ' ]]; then
STATUS="$ZSH_THEME_GIT_PROMPT_UNTRACKED$STATUS"
fi
- if $(echo "$INDEX" | grep '^A ' &> /dev/null); then
- STATUS="$ZSH_THEME_GIT_PROMPT_ADDED$STATUS"
- elif $(echo "$INDEX" | grep '^M ' &> /dev/null); then
- STATUS="$ZSH_THEME_GIT_PROMPT_ADDED$STATUS"
- elif $(echo "$INDEX" | grep '^MM ' &> /dev/null); then
+ if [[ "${INDEX}" =~ $'(^|\n)(A |M |MM) ' ]]; then
STATUS="$ZSH_THEME_GIT_PROMPT_ADDED$STATUS"
fi
- if $(echo "$INDEX" | grep '^ M ' &> /dev/null); then
- STATUS="$ZSH_THEME_GIT_PROMPT_MODIFIED$STATUS"
- elif $(echo "$INDEX" | grep '^AM ' &> /dev/null); then
- STATUS="$ZSH_THEME_GIT_PROMPT_MODIFIED$STATUS"
- elif $(echo "$INDEX" | grep '^MM ' &> /dev/null); then
- STATUS="$ZSH_THEME_GIT_PROMPT_MODIFIED$STATUS"
- elif $(echo "$INDEX" | grep '^ T ' &> /dev/null); then
+ if [[ "${INDEX}" =~ $'(^|\n)([ AM]M| T) ' ]]; then
STATUS="$ZSH_THEME_GIT_PROMPT_MODIFIED$STATUS"
fi
- if $(echo "$INDEX" | grep '^R ' &> /dev/null); then
+ if [[ "${INDEX}" =~ $'(^|\n)R ' ]]; then
STATUS="$ZSH_THEME_GIT_PROMPT_RENAMED$STATUS"
fi
- if $(echo "$INDEX" | grep '^ D ' &> /dev/null); then
- STATUS="$ZSH_THEME_GIT_PROMPT_DELETED$STATUS"
- elif $(echo "$INDEX" | grep '^D ' &> /dev/null); then
- STATUS="$ZSH_THEME_GIT_PROMPT_DELETED$STATUS"
- elif $(echo "$INDEX" | grep '^AD ' &> /dev/null); then
+ if [[ "${INDEX}" =~ $'(^|\n)([A ]D|D ) ' ]]; then
STATUS="$ZSH_THEME_GIT_PROMPT_DELETED$STATUS"
fi
- if $(command git rev-parse --verify refs/stash >/dev/null 2>&1); then
+ if $(__git_prompt_git rev-parse --verify refs/stash >/dev/null 2>&1); then
STATUS="$ZSH_THEME_GIT_PROMPT_STASHED$STATUS"
fi
- if $(echo "$INDEX" | grep '^UU ' &> /dev/null); then
+ if [[ "${INDEX}" =~ $'(^|\n)UU ' ]]; then
STATUS="$ZSH_THEME_GIT_PROMPT_UNMERGED$STATUS"
fi
- if $(echo "$INDEX" | grep '^## [^ ]\+ .*ahead' &> /dev/null); then
+ if [[ "${INDEX}" =~ $'(^|\n)## [^ ]\+ .*ahead' ]]; then
STATUS="$ZSH_THEME_GIT_PROMPT_AHEAD$STATUS"
fi
- if $(echo "$INDEX" | grep '^## [^ ]\+ .*behind' &> /dev/null); then
+ if [[ "${INDEX}" =~ $'(^|\n)## [^ ]\+ .*behind' ]]; then
STATUS="$ZSH_THEME_GIT_PROMPT_BEHIND$STATUS"
fi
- if $(echo "$INDEX" | grep '^## [^ ]\+ .*diverged' &> /dev/null); then
+ if [[ "${INDEX}" =~ $'(^|\n)## [^ ]\+ .*diverged' ]]; then
STATUS="$ZSH_THEME_GIT_PROMPT_DIVERGED$STATUS"
fi
echo $STATUS
@@ -191,20 +190,20 @@ function git_prompt_status() {
# Outputs the name of the current user
# Usage example: $(git_current_user_name)
function git_current_user_name() {
- command git config user.name 2>/dev/null
+ __git_prompt_git config user.name 2>/dev/null
}
# Outputs the email of the current user
# Usage example: $(git_current_user_email)
function git_current_user_email() {
- command git config user.email 2>/dev/null
+ __git_prompt_git config user.email 2>/dev/null
}
# Output the name of the root directory of the git repository
# Usage example: $(git_repo_name)
function git_repo_name() {
local repo_path
- if repo_path="$(git rev-parse --show-toplevel 2>/dev/null)" && [[ -n "$repo_path" ]]; then
+ if repo_path="$(__git_prompt_git rev-parse --show-toplevel 2>/dev/null)" && [[ -n "$repo_path" ]]; then
echo ${repo_path:t}
fi
}
diff --git a/lib/termsupport.zsh b/lib/termsupport.zsh
index 069b7f328..682925211 100644
--- a/lib/termsupport.zsh
+++ b/lib/termsupport.zsh
@@ -17,7 +17,7 @@ function title {
: ${2=$1}
case "$TERM" in
- cygwin|xterm*|putty*|rxvt*|konsole*|ansi|mlterm)
+ cygwin|xterm*|putty*|rxvt*|konsole*|ansi|mlterm*)
print -Pn "\e]2;$2:q\a" # set window name
print -Pn "\e]1;$1:q\a" # set tab name
;;
diff --git a/lib/theme-and-appearance.zsh b/lib/theme-and-appearance.zsh
index 5c1b6db12..0b71de372 100644
--- a/lib/theme-and-appearance.zsh
+++ b/lib/theme-and-appearance.zsh
@@ -40,7 +40,7 @@ if [[ "$DISABLE_LS_COLORS" != "true" ]]; then
fi
# enable diff color if possible.
-if diff --color . . &>/dev/null; then
+if command diff --color . . &>/dev/null; then
alias diff='diff --color'
fi
diff --git a/plugins/aws/aws.plugin.zsh b/plugins/aws/aws.plugin.zsh
index 4b5446407..7994963c3 100644
--- a/plugins/aws/aws.plugin.zsh
+++ b/plugins/aws/aws.plugin.zsh
@@ -41,7 +41,7 @@ function aws_change_access_key() {
function aws_profiles() {
[[ -r "${AWS_CONFIG_FILE:-$HOME/.aws/config}" ]] || return 1
- grep '\[profile' "${AWS_CONFIG_FILE:-$HOME/.aws/config}"|sed -e 's/.*profile \([a-zA-Z0-9_\.-]*\).*/\1/'
+ grep '\[profile' "${AWS_CONFIG_FILE:-$HOME/.aws/config}"|sed -e 's/.*profile \([a-zA-Z0-9@_\.-]*\).*/\1/'
}
function _aws_profiles() {
@@ -63,7 +63,7 @@ fi
# Load awscli completions
# AWS CLI v2 comes with its own autocompletion. Check if that is there, otherwise fall back
-if [[ -x /usr/local/bin/aws_completer ]]; then
+if command -v aws_completer &> /dev/null; then
autoload -Uz bashcompinit && bashcompinit
complete -C aws_completer aws
else
diff --git a/plugins/battery/README.md b/plugins/battery/README.md
index b7a13a7ec..c2554a36d 100644
--- a/plugins/battery/README.md
+++ b/plugins/battery/README.md
@@ -9,5 +9,14 @@ To use, add `battery` to the list of plugins in your `.zshrc` file:
Then, add the `battery_pct_prompt` function to your custom theme. For example:
```
-RPROMPT='$(battery_pct_prompt)'
+RPROMPT='$(battery_pct_prompt) ...'
+```
+
+## Requirements
+
+On Linux, you must have the `acpi` tool installed on your operating system.
+
+Here's an example of how to install with apt:
+```
+sudo apt-get install acpi
```
diff --git a/plugins/docker-compose/README.md b/plugins/docker-compose/README.md
index 1105e03f6..a81c2c78e 100644
--- a/plugins/docker-compose/README.md
+++ b/plugins/docker-compose/README.md
@@ -28,3 +28,4 @@ plugins=(... docker-compose)
| dclf | `docker-compose logs -f` | Show logs and follow output |
| dcpull | `docker-compose pull` | Pull image of a service |
| dcstart | `docker-compose start` | Start a container |
+| dck | `docker-compose kill` | Kills containers |
diff --git a/plugins/docker-compose/docker-compose.plugin.zsh b/plugins/docker-compose/docker-compose.plugin.zsh
index 9ffe1edf6..5b25b63b9 100644
--- a/plugins/docker-compose/docker-compose.plugin.zsh
+++ b/plugins/docker-compose/docker-compose.plugin.zsh
@@ -24,3 +24,4 @@ alias dcl='docker-compose logs'
alias dclf='docker-compose logs -f'
alias dcpull='docker-compose pull'
alias dcstart='docker-compose start'
+alias dck='docker-compose kill'
diff --git a/plugins/dotenv/README.md b/plugins/dotenv/README.md
index f66124731..ab9d329f6 100644
--- a/plugins/dotenv/README.md
+++ b/plugins/dotenv/README.md
@@ -53,24 +53,30 @@ Set `ZSH_DOTENV_PROMPT=false` in your zshrc file if you don't want the confirmat
You can also choose the `Always` option when prompted to always allow sourcing the .env file
in that directory. See the next section for more details.
-### ZSH_DOTENV_ALLOWED_LIST
+### ZSH_DOTENV_ALLOWED_LIST, ZSH_DOTENV_DISALLOWED_LIST
The default behavior of the plugin is to always ask whether to source a dotenv file. There's
-a **Y**es, **N**o, and **A**lways option. If you choose Always, the directory of the .env file
-will be added to an allowed list. If a directory is found in this list, the plugin won't ask
-for confirmation and will instead source the .env file directly.
+a **Y**es, **N**o, **A**lways and N**e**ver option. If you choose Always, the directory of the .env file
+will be added to an allowed list; if you choose Never, it will be added to a disallowed list.
+If a directory is found in either of those lists, the plugin won't ask for confirmation and will
+instead either source the .env file or proceed without action respectively.
-This allowed list is saved by default in `$ZSH_CACHE_DIR/dotenv-allowed.list`. If you want
-to change that location, change the `$ZSH_DOTENV_ALLOWED_LIST` variable, like so:
+The allowed and disallowed lists are saved by default in `$ZSH_CACHE_DIR/dotenv-allowed.list` and
+`$ZSH_CACHE_DIR/dotenv-disallowed.list` respectively. If you want to change that location,
+change the `$ZSH_DOTENV_ALLOWED_LIST` and `$ZSH_DOTENV_DISALLOWED_LIST` variables, like so:
```zsh
# in ~/.zshrc, before Oh My Zsh is sourced:
ZSH_DOTENV_ALLOWED_LIST=/path/to/dotenv/allowed/list
+ZSH_DOTENV_DISALLOWED_LIST=/path/to/dotenv/disallowed/list
```
-This file is just a list of directories allowed, separated by a newline character. If you want
-to disallow a directory, just edit this file and remove the line for the directory you want to
-disallow.
+The file is just a list of directories, separated by a newline character. If you want
+to change your decision, just edit the file and remove the line for the directory you want to
+change.
+
+NOTE: if a directory is found in both the allowed and disallowed lists, the disallowed list
+takes preference, _i.e._ the .env file will never be sourced.
## Version Control
diff --git a/plugins/dotenv/dotenv.plugin.zsh b/plugins/dotenv/dotenv.plugin.zsh
index ac3210d7f..24f285df5 100644
--- a/plugins/dotenv/dotenv.plugin.zsh
+++ b/plugins/dotenv/dotenv.plugin.zsh
@@ -5,6 +5,7 @@
# Path to the file containing allowed paths
: ${ZSH_DOTENV_ALLOWED_LIST:="${ZSH_CACHE_DIR:-$ZSH/cache}/dotenv-allowed.list"}
+: ${ZSH_DOTENV_DISALLOWED_LIST:="${ZSH_CACHE_DIR:-$ZSH/cache}/dotenv-disallowed.list"}
## Functions
@@ -14,19 +15,26 @@ source_env() {
if [[ "$ZSH_DOTENV_PROMPT" != false ]]; then
local confirmation dirpath="${PWD:A}"
- # make sure there is an allowed file
+ # make sure there is an (dis-)allowed file
touch "$ZSH_DOTENV_ALLOWED_LIST"
+ touch "$ZSH_DOTENV_DISALLOWED_LIST"
+
+ # early return if disallowed
+ if grep -q "$dirpath" "$ZSH_DOTENV_DISALLOWED_LIST" &>/dev/null; then
+ return;
+ fi
# check if current directory's .env file is allowed or ask for confirmation
if ! grep -q "$dirpath" "$ZSH_DOTENV_ALLOWED_LIST" &>/dev/null; then
# print same-line prompt and output newline character if necessary
- echo -n "dotenv: found '$ZSH_DOTENV_FILE' file. Source it? ([Y]es/[n]o/[a]lways) "
+ echo -n "dotenv: found '$ZSH_DOTENV_FILE' file. Source it? ([Y]es/[n]o/[a]lways/n[e]ver) "
read -k 1 confirmation; [[ "$confirmation" != $'\n' ]] && echo
# check input
case "$confirmation" in
[nN]) return ;;
[aA]) echo "$dirpath" >> "$ZSH_DOTENV_ALLOWED_LIST" ;;
+ [eE]) echo "$dirpath" >> "$ZSH_DOTENV_DISALLOWED_LIST"; return ;;
*) ;; # interpret anything else as a yes
esac
fi
diff --git a/plugins/extract/README.md b/plugins/extract/README.md
index 81e8e1d23..b2b731e39 100644
--- a/plugins/extract/README.md
+++ b/plugins/extract/README.md
@@ -23,6 +23,7 @@ plugins=(... extract)
| `bz2` | Bzip2 file |
| `deb` | Debian package |
| `gz` | Gzip file |
+| `ipa` | iOS app package |
| `ipsw` | iOS firmware file |
| `jar` | Java Archive |
| `lrz` | LRZ archive |
diff --git a/plugins/extract/_extract b/plugins/extract/_extract
index 1a263a744..f96f0d450 100644
--- a/plugins/extract/_extract
+++ b/plugins/extract/_extract
@@ -3,5 +3,5 @@
_arguments \
'(-r --remove)'{-r,--remove}'[Remove archive.]' \
- "*::archive file:_files -g '(#i)*.(7z|Z|apk|aar|bz2|deb|gz|ipsw|jar|lrz|lz4|lzma|rar|rpm|sublime-package|tar|tar.bz2|tar.gz|tar.lrz|tar.lz|tar.lz4|tar.xz|tar.zma|tar.zst|tbz|tbz2|tgz|tlz|txz|tzst|war|whl|xpi|xz|zip|zst)(-.)'" \
+ "*::archive file:_files -g '(#i)*.(7z|Z|apk|aar|bz2|deb|gz|ipa|ipsw|jar|lrz|lz4|lzma|rar|rpm|sublime-package|tar|tar.bz2|tar.gz|tar.lrz|tar.lz|tar.lz4|tar.xz|tar.zma|tar.zst|tbz|tbz2|tgz|tlz|txz|tzst|war|whl|xpi|xz|zip|zst)(-.)'" \
&& return 0
diff --git a/plugins/extract/extract.plugin.zsh b/plugins/extract/extract.plugin.zsh
index a5594b81a..46e69f08d 100644
--- a/plugins/extract/extract.plugin.zsh
+++ b/plugins/extract/extract.plugin.zsh
@@ -55,7 +55,7 @@ extract() {
(*.lz4) lz4 -d "$1" ;;
(*.lzma) unlzma "$1" ;;
(*.z) uncompress "$1" ;;
- (*.zip|*.war|*.jar|*.sublime-package|*.ipsw|*.xpi|*.apk|*.aar|*.whl) unzip "$1" -d $extract_dir ;;
+ (*.zip|*.war|*.jar|*.sublime-package|*.ipa|*.ipsw|*.xpi|*.apk|*.aar|*.whl) unzip "$1" -d $extract_dir ;;
(*.rar) unrar x -ad "$1" ;;
(*.rpm) mkdir "$extract_dir" && cd "$extract_dir" && rpm2cpio "../$1" | cpio --quiet -id && cd .. ;;
(*.7z) 7za x "$1" ;;
diff --git a/plugins/httpie/README.md b/plugins/httpie/README.md
index 25bdd0c7d..40d60c47d 100644
--- a/plugins/httpie/README.md
+++ b/plugins/httpie/README.md
@@ -11,4 +11,10 @@ plugins=(... httpie)
It uses completion from [zsh-completions](https://github.com/zsh-users/zsh-completions).
+## Aliases
+
+| Alias | Command |
+| ------------ | ---------------------------------------------------------------- |
+| `https` | `http --default-scheme=https` |
+
**Maintainer:** [lululau](https://github.com/lululau)
diff --git a/plugins/httpie/httpie.plugin.zsh b/plugins/httpie/httpie.plugin.zsh
new file mode 100644
index 000000000..088a1f1cf
--- /dev/null
+++ b/plugins/httpie/httpie.plugin.zsh
@@ -0,0 +1,7 @@
+#
+# Aliases
+# (sorted alphabetically)
+#
+
+alias https='http --default-scheme=https'
+
diff --git a/plugins/kubectl/README.md b/plugins/kubectl/README.md
index c0db59362..ee05a8af1 100644
--- a/plugins/kubectl/README.md
+++ b/plugins/kubectl/README.md
@@ -33,7 +33,8 @@ plugins=(... kubectl)
| kep | `kubectl edit pods` | Edit pods from the default editor |
| kdp | `kubectl describe pods` | Describe all pods |
| kdelp | `kubectl delete pods` | Delete all pods matching passed arguments |
-| kgpl | `kgp -l` | Get pod by label. Example: `kgpl "app=myapp" -n myns` |
+| kgpl | `kgp -l` | Get pods by label. Example: `kgpl "app=myapp" -n myns` |
+| kgpn | `kgp -n` | Get pods by namespace. Example: `kgpn kube-system` |
| | | **Service management** |
| kgs | `kubectl get svc` | List all services in ps output format |
| kgsw | `kgs --watch` | After listing all services, watch for changes |
diff --git a/plugins/kubectl/kubectl.plugin.zsh b/plugins/kubectl/kubectl.plugin.zsh
index 92688c53c..647d029c1 100644
--- a/plugins/kubectl/kubectl.plugin.zsh
+++ b/plugins/kubectl/kubectl.plugin.zsh
@@ -47,6 +47,9 @@ alias kdelp='kubectl delete pods'
# get pod by label: kgpl "app=myapp" -n myns
alias kgpl='kgp -l'
+# get pod by namespace: kgpn kube-system"
+alias kgpn='kgp -n'
+
# Service management.
alias kgs='kubectl get svc'
alias kgsa='kubectl get svc --all-namespaces'
diff --git a/plugins/mix-fast/mix-fast.plugin.zsh b/plugins/mix-fast/mix-fast.plugin.zsh
index e27e30d64..564c50561 100644
--- a/plugins/mix-fast/mix-fast.plugin.zsh
+++ b/plugins/mix-fast/mix-fast.plugin.zsh
@@ -12,7 +12,7 @@ _mix_does_task_list_need_generating () {
}
_mix_generate () {
- mix help | grep -v 'iex -S' | tail -n +2 | cut -d " " -f 2 > .mix_tasks
+ mix help | grep '^mix [^ ]' | sed -E "s/mix ([^ ]*) *# (.*)/\1:\2/" > .mix_tasks
}
_mix () {
@@ -21,7 +21,8 @@ _mix () {
echo "\nGenerating .mix_tasks..." > /dev/stderr
_mix_generate
fi
- compadd `cat .mix_tasks`
+ local tasks=(${(f)"$(cat .mix_tasks)"})
+ _describe 'tasks' tasks
fi
}
diff --git a/plugins/sudo/sudo.plugin.zsh b/plugins/sudo/sudo.plugin.zsh
index f405b025f..51579377d 100644
--- a/plugins/sudo/sudo.plugin.zsh
+++ b/plugins/sudo/sudo.plugin.zsh
@@ -13,15 +13,28 @@
# ------------------------------------------------------------------------------
sudo-command-line() {
- [[ -z $BUFFER ]] && zle up-history
- if [[ $BUFFER == sudo\ * ]]; then
- LBUFFER="${LBUFFER#sudo }"
- elif [[ $BUFFER == $EDITOR\ * ]]; then
- LBUFFER="${LBUFFER#$EDITOR }"
- LBUFFER="sudoedit $LBUFFER"
+ [[ -z $BUFFER ]] && LBUFFER="$(fc -ln -1)"
+ if [[ -n $EDITOR && $BUFFER == $EDITOR\ * ]]; then
+ if [[ ${#LBUFFER} -le ${#EDITOR} ]]; then
+ RBUFFER=" ${BUFFER#$EDITOR }"
+ LBUFFER="sudoedit"
+ else
+ LBUFFER="sudoedit ${LBUFFER#$EDITOR }"
+ fi
elif [[ $BUFFER == sudoedit\ * ]]; then
- LBUFFER="${LBUFFER#sudoedit }"
- LBUFFER="$EDITOR $LBUFFER"
+ if [[ ${#LBUFFER} -le 8 ]]; then
+ RBUFFER=" ${BUFFER#sudoedit }"
+ LBUFFER="$EDITOR"
+ else
+ LBUFFER="$EDITOR ${LBUFFER#sudoedit }"
+ fi
+ elif [[ $BUFFER == sudo\ * ]]; then
+ if [[ ${#LBUFFER} -le 4 ]]; then
+ RBUFFER="${BUFFER#sudo }"
+ LBUFFER=""
+ else
+ LBUFFER="${LBUFFER#sudo }"
+ fi
else
LBUFFER="sudo $LBUFFER"
fi
diff --git a/plugins/timer/README.md b/plugins/timer/README.md
index 321307e59..30b0bd00e 100644
--- a/plugins/timer/README.md
+++ b/plugins/timer/README.md
@@ -3,6 +3,7 @@ This plugin allows to display command's execution time in a very nonintrusive wa
Timer can be tuned by these two variables:
* `TIMER_PRECISION` allows to control number of decimal places (default `1`)
* `TIMER_FORMAT` allows to adjust display format (default `'/%d'`)
+* `TIMER_THRESHOLD` allows to set the minimum execution time that causes the timer to be shown (default `0`)
Sample session:
diff --git a/plugins/timer/timer.plugin.zsh b/plugins/timer/timer.plugin.zsh
index 728377c5c..1be7516a3 100644
--- a/plugins/timer/timer.plugin.zsh
+++ b/plugins/timer/timer.plugin.zsh
@@ -19,9 +19,11 @@ __timer_display_timer_precmd() {
local cmd_end_time=$(__timer_current_time)
local tdiff=$((cmd_end_time - __timer_cmd_start_time))
unset __timer_cmd_start_time
- local tdiffstr=$(__timer_format_duration ${tdiff})
- local cols=$((COLUMNS - ${#tdiffstr} - 1))
- echo -e "\033[1A\033[${cols}C ${tdiffstr}"
+ if [[ -z "${TIMER_THRESHOLD}" || ${tdiff} -ge "${TIMER_THRESHOLD}" ]]; then
+ local tdiffstr=$(__timer_format_duration ${tdiff})
+ local cols=$((COLUMNS - ${#tdiffstr} - 1))
+ echo -e "\033[1A\033[${cols}C ${tdiffstr}"
+ fi
fi
}
diff --git a/plugins/vscode/README.md b/plugins/vscode/README.md
index 469c57ea8..e95ed5d4f 100644
--- a/plugins/vscode/README.md
+++ b/plugins/vscode/README.md
@@ -1,6 +1,6 @@
# VS Code
-This plugin makes interaction between the command line and the VS Code editor easier.
+This plugin provides useful aliases to simplify the interaction between the command line and VS Code or VSCodium editor.
To start using it, add the `vscode` plugin to your `plugins` array in `~/.zshrc`:
@@ -10,23 +10,37 @@ plugins=(... vscode)
## Requirements
-To use VS Code in the terminal **in macOS**, first you need to install the `code` command in the PATH,
-otherwise you might receive this message: `zsh: command not found: code`.
+This plugin requires to have a flavour of VS Code installed and it's executable available in PATH.
-[As the docs say](https://code.visualstudio.com/docs/setup/mac#_launching-from-the-command-line), open
+You can install either:
+
+* VS Code (code)
+* VS Code Insiders (code-insiders)
+* VSCodium (codium)
+
+### MacOS
+While Linux installations will add the executable to PATH, MacOS users might still have to do this manually:
+
+[For VS Code and VS Code Insiders](https://code.visualstudio.com/docs/setup/mac#_launching-from-the-command-line), open
the Command Palette via (F1 or โ‡งโŒ˜P) and type shell command to find the Shell Command:
-> Install 'code' command in PATH
+> Shell Command: Install 'code' command in PATH
-## VS Code Insiders
+[For VSCodium](https://github.com/VSCodium/vscodium/blob/master/DOCS.md#how-do-i-open-vscodium-from-the-terminal), open
+the Command Palette via (F1 or โ‡งโŒ˜P) and type shell command to find the Shell Command:
+> Shell Command: Install 'codium' command in PATH
-๐Ÿ **If you are only using [VS Code Insiders](https://code.visualstudio.com/insiders/), the plugin will automatically bind to your Insiders installation.**
+## Using multiple flavours
-But, if you have both Stable and Insiders versions and want to configure the plugin to just use the Insiders version, add the following line in the oh-my-zsh settings section (between the `ZSH_THEME` and the `plugins=()` line). This will make the plugin use the Insiders version instead.
+If for any reason, you ever require to use multiple flavours of VS Code i.e. VS Code (stable) and VS Code Insiders, you can
+manually specify the flavour's executable. Add the following line to the .zshrc file (between the `ZSH_THEME` and the `plugins=()` lines).
+This will make the plugin use your manually defined executable.
```zsh
ZSH_THEME=...
-# Add this line to use code-insiders instead of code
+# Choose between one [code, code-insiders or codium]
+# The following line will make the plugin to open VS Code Insiders
+# Invalid entries will be ignored, no aliases will be added
VSCODE=code-insiders
plugins=(... vscode)
diff --git a/plugins/vscode/vscode.plugin.zsh b/plugins/vscode/vscode.plugin.zsh
index 0144e0baa..48d904377 100644
--- a/plugins/vscode/vscode.plugin.zsh
+++ b/plugins/vscode/vscode.plugin.zsh
@@ -1,17 +1,28 @@
-# VScode zsh plugin
+# VS Code (stable / insiders) / VSCodium zsh plugin
# Authors:
# https://github.com/MarsiBarsi (original author)
# https://github.com/babakks
+# https://github.com/SteelShot
-# Use the stable VS Code release, unless the Insiders version is the only
-# available installation
-if ! which code > /dev/null && which code-insiders > /dev/null; then
- : ${VSCODE:=code-insiders}
-else
- : ${VSCODE:=code}
+# Verify if any manual user choice of VS Code exists first.
+if [[ -n "$VSCODE" ]] && ! which $VSCODE &>/dev/null; then
+ echo "'$VSCODE' flavour of VS Code not detected."
+ unset VSCODE
+fi
+
+# Otherwise, try to detect a flavour of VS Code.
+if [[ -z "$VSCODE" ]]; then
+ if which code &>/dev/null; then
+ VSCODE=code
+ elif which code-insiders &>/dev/null; then
+ VSCODE=code-insiders
+ elif which codium &>/dev/null; then
+ VSCODE=codium
+ else
+ return
+ fi
fi
-# Define aliases
alias vsc="$VSCODE ."
alias vsca="$VSCODE --add"
alias vscd="$VSCODE --diff"
diff --git a/plugins/yarn/README.md b/plugins/yarn/README.md
index 05f18a499..fd748b742 100644
--- a/plugins/yarn/README.md
+++ b/plugins/yarn/README.md
@@ -11,35 +11,36 @@ plugins=(... yarn)
## Aliases
-| Alias | Command | Description |
-|-------|-------------------------------------------|-------------------------------------------------------------|
-| y | `yarn` | The Yarn command |
-| ya | `yarn add` | Install a package in dependencies (`package.json`) |
-| yad | `yarn add --dev` | Install a package in devDependencies (`package.json`) |
-| yap | `yarn add --peer` | Install a package in peerDependencies (`package.json`) |
-| yb | `yarn build` | Run the build script defined in `package.json` |
-| ycc | `yarn cache clean` | Clean yarn's global cache of packages |
-| yd | `yarn dev` | Run the dev script defined in `package.json` |
-| yga | `yarn global add` | Install packages globally on your operating system |
-| ygls | `yarn global list` | Lists global installed packages |
-| ygrm | `yarn global remove` | Remove global installed packages from your OS |
-| ygu | `yarn global upgrade` | Upgrade packages installed globally to their latest version |
-| yh | `yarn help` | Show help for a yarn command |
-| yi | `yarn init` | Interactively creates or updates a package.json file |
-| yin | `yarn install` | Install dependencies defined in `package.json` |
-| yln | `yarn lint` | Run the lint script defined in `package.json` |
-| yls | `yarn list` | List installed packages |
-| yout | `yarn outdated` | Check for outdated package dependencies |
-| yp | `yarn pack` | Create a compressed gzip archive of package dependencies |
-| yrm | `yarn remove` | Remove installed packages |
-| yrun | `yarn run` | Run a defined package script |
-| ys | `yarn serve` | Start the dev server |
-| yst | `yarn start` | Run the start script defined in `package.json` |
-| yt | `yarn test` | Run the test script defined in `package.json` |
-| ytc | `yarn test --coverage` | Run the test script defined in `package.json` with coverage |
-| yuc | `yarn global upgrade && yarn cache clean` | Upgrade global packages and clean yarn's global cache |
-| yui | `yarn upgrade-interactive` | Prompt for which outdated packages to upgrade |
-| yup | `yarn upgrade` | Upgrade packages to their latest version |
-| yv | `yarn version` | Update the version of your package |
-| yw | `yarn workspace` | Run a command within a single workspace. |
-| yws | `yarn workspaces` | Run a command within all defined workspaces. |
+| Alias | Command | Description |
+| ----- | ----------------------------------------- | ----------------------------------------------------------------------------- |
+| y | `yarn` | The Yarn command |
+| ya | `yarn add` | Install a package in dependencies (`package.json`) |
+| yad | `yarn add --dev` | Install a package in devDependencies (`package.json`) |
+| yap | `yarn add --peer` | Install a package in peerDependencies (`package.json`) |
+| yb | `yarn build` | Run the build script defined in `package.json` |
+| ycc | `yarn cache clean` | Clean yarn's global cache of packages |
+| yd | `yarn dev` | Run the dev script defined in `package.json` |
+| yga | `yarn global add` | Install packages globally on your operating system |
+| ygls | `yarn global list` | Lists global installed packages |
+| ygrm | `yarn global remove` | Remove global installed packages from your OS |
+| ygu | `yarn global upgrade` | Upgrade packages installed globally to their latest version |
+| yh | `yarn help` | Show help for a yarn command |
+| yi | `yarn init` | Interactively creates or updates a package.json file |
+| yin | `yarn install` | Install dependencies defined in `package.json` |
+| yln | `yarn lint` | Run the lint script defined in `package.json` |
+| yls | `yarn list` | List installed packages |
+| yout | `yarn outdated` | Check for outdated package dependencies |
+| yp | `yarn pack` | Create a compressed gzip archive of package dependencies |
+| yrm | `yarn remove` | Remove installed packages |
+| yrun | `yarn run` | Run a defined package script |
+| ys | `yarn serve` | Start the dev server |
+| yst | `yarn start` | Run the start script defined in `package.json` |
+| yt | `yarn test` | Run the test script defined in `package.json` |
+| ytc | `yarn test --coverage` | Run the test script defined in `package.json` with coverage |
+| yuc | `yarn global upgrade && yarn cache clean` | Upgrade global packages and clean yarn's global cache |
+| yui | `yarn upgrade-interactive` | Prompt for which outdated packages to upgrade |
+| yuil | `yarn upgrade-interactive --latest` | Prompt for which outdated packages to upgrade to the latest available version |
+| yup | `yarn upgrade` | Upgrade packages to their latest version |
+| yv | `yarn version` | Update the version of your package |
+| yw | `yarn workspace` | Run a command within a single workspace. |
+| yws | `yarn workspaces` | Run a command within all defined workspaces. |
diff --git a/plugins/yarn/yarn.plugin.zsh b/plugins/yarn/yarn.plugin.zsh
index 9cfcb7539..4a5192c61 100644
--- a/plugins/yarn/yarn.plugin.zsh
+++ b/plugins/yarn/yarn.plugin.zsh
@@ -24,6 +24,7 @@ alias yt="yarn test"
alias ytc="yarn test --coverage"
alias yuc="yarn global upgrade && yarn cache clean"
alias yui="yarn upgrade-interactive"
+alias yuil="yarn upgrade-interactive --latest"
alias yup="yarn upgrade"
alias yv="yarn version"
alias yw="yarn workspace"
diff --git a/templates/zshrc.zsh-template b/templates/zshrc.zsh-template
index 0fa6d809e..307618104 100644
--- a/templates/zshrc.zsh-template
+++ b/templates/zshrc.zsh-template
@@ -33,7 +33,7 @@ ZSH_THEME="robbyrussell"
# export UPDATE_ZSH_DAYS=13
# Uncomment the following line if pasting URLs and other text is messed up.
-# DISABLE_MAGIC_FUNCTIONS=true
+# DISABLE_MAGIC_FUNCTIONS="true"
# Uncomment the following line to disable colors in ls.
# DISABLE_LS_COLORS="true"
diff --git a/themes/mlh.zsh-theme b/themes/mlh.zsh-theme
new file mode 100644
index 000000000..a21a546bc
--- /dev/null
+++ b/themes/mlh.zsh-theme
@@ -0,0 +1,59 @@
+# The Official Theme of
+## ## ## ## ##
+### ### ## ## ##
+#### #### ## ## ##
+## ### ## ## #########
+## ## ## ## ##
+## ## ## ## ##
+## ## ######## ## ##
+
+# # # # # # # # # # # # # # # # # #
+# # # Feel free to customize! # # #
+# # # # # # # # # # # # # # # # # #
+
+# To easily discover colors and their codes, type `spectrum_ls` in the terminal
+
+AT_SYMBOL=" @ "
+IN_SYMBOL=" in "
+ON_SYMBOL=" on "
+SYMBOL="$"
+
+USER_COLOR="%F{001}"
+DEVICE_COLOR="%F{033}"
+DIR_COLOR="%F{220}"
+BRANCH_COLOR="%F{001}"
+TIME_COLOR="%F{033}"
+
+username() {
+ echo "$USER_COLOR%n%f"
+}
+
+# Returns device name
+device() {
+ echo "$DEVICE_COLOR%m%f"
+}
+
+# The current directory
+directory() {
+ echo "$DIR_COLOR%1~%f"
+}
+
+# Current time with milliseconds
+current_time() {
+ echo "$TIME_COLOR%*%f"
+}
+
+# Return status of the last command
+return_status() {
+ echo "%(?..%F{001}out %?)%f"
+}
+
+# Set the git_prompt_info text
+ZSH_THEME_GIT_PROMPT_PREFIX="${ON_SYMBOL}${BRANCH_COLOR}"
+ZSH_THEME_GIT_PROMPT_SUFFIX="%f"
+ZSH_THEME_GIT_PROMPT_DIRTY=""
+ZSH_THEME_GIT_PROMPT_CLEAN=""
+
+# %B and %b make the text bold
+PROMPT='%b$(username)$AT_SYMBOL$(device)$IN_SYMBOL$(directory)$(git_prompt_info)%b $SYMBOL '
+RPROMPT="$(return_status) $(current_time)"
diff --git a/tools/check_for_upgrade.sh b/tools/check_for_upgrade.sh
index c91431c25..cadd5fe49 100644
--- a/tools/check_for_upgrade.sh
+++ b/tools/check_for_upgrade.sh
@@ -51,7 +51,7 @@ function update_ohmyzsh() {
# The return status from the function is handled specially. If it is zero, the signal is
# assumed to have been handled, and execution continues normally. Otherwise, the shell
# will behave as interrupted except that the return status of the trap is retained.
- trap "rm -rf '$ZSH/log/update.lock'; return 1" EXIT INT QUIT
+ trap "command rm -rf '$ZSH/log/update.lock'; return 1" EXIT INT QUIT
# Create or update .zsh-update file if missing or malformed
if ! source "${ZSH_CACHE_DIR}/.zsh-update" 2>/dev/null || [[ -z "$LAST_EPOCH" ]]; then