diff --git a/plugins/aliases/README.md b/plugins/aliases/README.md index 6a2da3d74..419554095 100644 --- a/plugins/aliases/README.md +++ b/plugins/aliases/README.md @@ -15,14 +15,14 @@ Requirements: Python needs to be installed. ## Usage -- `acs`: show all aliases by group +- `als`: show all aliases by group -- `acs -h/--help`: print help mesage +- `als -h/--help`: print help mesage -- `acs `: filter and highlight aliases by `` +- `als `: filter and highlight aliases by `` -- `acs -g /--group `: show only aliases for group ``. Multiple uses of the flag show all groups +- `als -g /--group `: show only aliases for group ``. Multiple uses of the flag show all groups -- `acs --groups`: show only group names +- `als --groups`: show only group names ![screenshot](https://cloud.githubusercontent.com/assets/3602957/11581913/cb54fb8a-9a82-11e5-846b-5a67f67ad9ad.png) diff --git a/plugins/aliases/aliases.plugin.zsh b/plugins/aliases/aliases.plugin.zsh index 9864de957..7f1ba83b8 100644 --- a/plugins/aliases/aliases.plugin.zsh +++ b/plugins/aliases/aliases.plugin.zsh @@ -4,7 +4,7 @@ 0="${${(M)0:#/*}:-$PWD/$0}" eval ' - function acs(){ + function als(){ (( $+commands[python3] )) || { echo "[error] No python executable detected" return diff --git a/plugins/aliases/cheatsheet.py b/plugins/aliases/cheatsheet.py index f742fba9e..61bf5f956 100644 --- a/plugins/aliases/cheatsheet.py +++ b/plugins/aliases/cheatsheet.py @@ -57,7 +57,7 @@ def pretty_print(cheatsheet, wfilter, group_list=None, groups_only=False): pretty_print_group(key, [ alias for alias in aliases if alias[0].find(wfilter)>-1 or alias[1].find(wfilter)>-1], wfilter) if __name__ == '__main__': - parser = argparse.ArgumentParser(description="Pretty print aliases.", prog="acs") + parser = argparse.ArgumentParser(description="Pretty print aliases.", prog="als") parser.add_argument('filter', nargs="*", metavar="", help="search aliases matching keywords") parser.add_argument('-g', '--group', dest="group_list", action='append', help="only print aliases in given groups") parser.add_argument('--groups', dest='groups_only', action='store_true', help="only print alias groups") diff --git a/plugins/debian/README.md b/plugins/debian/README.md index c1ebe1c50..1db534f13 100644 --- a/plugins/debian/README.md +++ b/plugins/debian/README.md @@ -21,7 +21,7 @@ Set `$apt_pref` and `$apt_upgr` to whatever command you want (before sourcing Oh | ------ | ---------------------------------------------------------------------- | ---------------------------------------------------------- | | `age` | `apt-get` | Command line tool for handling packages | | `api` | `aptitude` | Same functionality as `apt-get`, provides extra options | -| `acse` | `apt-cache search` | Command line tool for searching apt software package cache | +| `acs` | `apt-cache search` | Command line tool for searching apt software package cache | | `aps` | `aptitude search` | Searches installed packages using aptitude | | `as` | `aptitude -F '* %p -> %d \n(%v/%V)' --no-gui --disable-columns search` | Print searched packages using a custom format | | `afs` | `apt-file search --regexp` | Search file in packages | diff --git a/plugins/debian/debian.plugin.zsh b/plugins/debian/debian.plugin.zsh index bab1ae1c6..5ef4cfb67 100644 --- a/plugins/debian/debian.plugin.zsh +++ b/plugins/debian/debian.plugin.zsh @@ -26,7 +26,7 @@ alias age='apt-get' alias api='aptitude' # Some self-explanatory aliases -alias acse="apt-cache search" +alias acs="apt-cache search" alias aps='aptitude search' alias as="aptitude -F '* %p -> %d \n(%v/%V)' --no-gui --disable-columns search" diff --git a/plugins/docker/README.md b/plugins/docker/README.md index 512b5d17c..0ab2e41fb 100644 --- a/plugins/docker/README.md +++ b/plugins/docker/README.md @@ -30,6 +30,15 @@ file**, but be aware of the side effects: > zstyle ':completion:*:*:docker-*:*' option-stacking yes > ``` +### Use old-style completion + +If the current completion does not work well for you, you can enable legacy completion instead with the +following setting. See https://github.com/ohmyzsh/ohmyzsh/issues/11789 for more information. + +```zsh +zstyle ':omz:plugins:docker' legacy-completion yes +``` + ## Aliases | Alias | Command | Description | @@ -58,7 +67,7 @@ file**, but be aware of the side effects: | drm | `docker container rm` | Remove the specified container(s) | | drm! | `docker container rm -f` | Force the removal of a running container (uses SIGKILL) | | dst | `docker container start` | Start one or more stopped containers | -| drs | `docker container restart` | Restart one or more containers +| drs | `docker container restart` | Restart one or more containers | | dsta | `docker stop $(docker ps -q)` | Stop all running containers | | dstp | `docker container stop` | Stop one or more running containers | | dtop | `docker top` | Display the running processes of a container | diff --git a/plugins/docker/docker.plugin.zsh b/plugins/docker/docker.plugin.zsh index 7777048a3..7e657f2df 100644 --- a/plugins/docker/docker.plugin.zsh +++ b/plugins/docker/docker.plugin.zsh @@ -41,21 +41,22 @@ fi 0="${${ZERO:-${0:#$ZSH_ARGZERO}}:-${(%):-%N}}" 0="${${(M)0:#/*}:-$PWD/$0}" +# If the completion file doesn't exist yet, we need to autoload it and +# bind it to `docker`. Otherwise, compinit will have already done that. +if [[ ! -f "$ZSH_CACHE_DIR/completions/_docker" ]]; then + typeset -g -A _comps + autoload -Uz _docker + _comps[docker]=_docker +fi + { + # `docker completion` is only available from 23.0.0 on # docker version returns `Docker version 24.0.2, build cb74dfcd85` # with `s:,:` remove the comma after the version, and select third word of it - local _docker_version=${${(s:,:z)"$(command docker --version)"}[3]} - # `docker completion` is only available from 23.0.0 on - if is-at-least 23.0.0 $_docker_version; then - # If the completion file doesn't exist yet, we need to autoload it and - # bind it to `docker`. Otherwise, compinit will have already done that. - if [[ ! -f "$ZSH_CACHE_DIR/completions/_docker" ]]; then - typeset -g -A _comps - autoload -Uz _docker - _comps[docker]=_docker - fi - command docker completion zsh >| "$ZSH_CACHE_DIR/completions/_docker" - else - command cp "${0:h}/completions/_docker" "$ZSH_CACHE_DIR/completions/_docker" + if zstyle -t ':omz:plugins:docker' legacy-completion || \ + ! is-at-least 23.0.0 ${${(s:,:z)"$(command docker --version)"}[3]}; then + command cp "${0:h}/completions/_docker" "$ZSH_CACHE_DIR/completions/_docker" + else + command docker completion zsh >| "$ZSH_CACHE_DIR/completions/_docker" fi } &| diff --git a/plugins/nvm/README.md b/plugins/nvm/README.md index eee3bf717..b5ef221d3 100644 --- a/plugins/nvm/README.md +++ b/plugins/nvm/README.md @@ -52,12 +52,7 @@ version to load. This can be done, similar as previous options, adding: ```zsh zstyle ':omz:plugins:nvm' autoload yes -``` - -To remove the output generated by NVM when autoloading, you can set the following option: - -```zsh -zstyle ':omz:plugins:nvm' silent-autoload yes +zstyle ':omz:plugins:nvm' silent-autoload yes # optionally remove the output generated by NVM when autoloading ``` Note: _this will not remove regular `nvm` output_ diff --git a/plugins/nvm/nvm.plugin.zsh b/plugins/nvm/nvm.plugin.zsh index 484ef2964..1badbeab5 100644 --- a/plugins/nvm/nvm.plugin.zsh +++ b/plugins/nvm/nvm.plugin.zsh @@ -16,13 +16,7 @@ fi # Note: nvm is a function so we need to use `which` which nvm &>/dev/null && return -if [[ -z "$NVM_DIR" ]]; then - echo "[oh-my-zsh] nvm installation cannot be found" - echo "[oh-my-zsh] set NVM_DIR to your installation" - return -fi -if [[ ! -f "$NVM_DIR/nvm.sh" ]]; then - echo "[oh-my-zsh] nvm.sh does not exist in $NVM_DIR" +if [[ -z "$NVM_DIR" ]] || [[ ! -f "$NVM_DIR/nvm.sh" ]]; then return fi diff --git a/plugins/per-directory-history/per-directory-history.zsh b/plugins/per-directory-history/per-directory-history.zsh index 7cd673cdb..acbd64757 100644 --- a/plugins/per-directory-history/per-directory-history.zsh +++ b/plugins/per-directory-history/per-directory-history.zsh @@ -81,6 +81,7 @@ function per-directory-history-toggle-history() { autoload per-directory-history-toggle-history zle -N per-directory-history-toggle-history bindkey $PER_DIRECTORY_HISTORY_TOGGLE per-directory-history-toggle-history +bindkey -M vicmd $PER_DIRECTORY_HISTORY_TOGGLE per-directory-history-toggle-history #------------------------------------------------------------------------------- # implementation details diff --git a/plugins/tig/tig.plugin.zsh b/plugins/tig/tig.plugin.zsh index 7e0c530ac..5b7d2550a 100644 --- a/plugins/tig/tig.plugin.zsh +++ b/plugins/tig/tig.plugin.zsh @@ -1,3 +1,5 @@ alias tis='tig status' alias til='tig log' alias tib='tig blame -C' +alias tif='tig reflog' +alias tia='tig --all' diff --git a/plugins/ubuntu/README.md b/plugins/ubuntu/README.md index 2401c102b..20f5c65ee 100644 --- a/plugins/ubuntu/README.md +++ b/plugins/ubuntu/README.md @@ -15,7 +15,7 @@ Commands that use `$APT` will use `apt` if installed or defer to `apt-get` other | Alias | Command | Description | |---------|--------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------| | age | `sudo $APT` | Run apt-get with sudo | -| acse | `apt-cache search` | Search the apt-cache with the specified criteria | +| acs | `apt-cache search` | Search the apt-cache with the specified criteria | | acsp | `apt-cache showpkg` | Shows information about the listed packages | | acp | `apt-cache policy` | Display the package source priorities | | afs | `apt-file search --regexp` | Perform a regular expression apt-file search | diff --git a/plugins/ubuntu/ubuntu.plugin.zsh b/plugins/ubuntu/ubuntu.plugin.zsh index 4d35da2ac..7b765a406 100644 --- a/plugins/ubuntu/ubuntu.plugin.zsh +++ b/plugins/ubuntu/ubuntu.plugin.zsh @@ -1,6 +1,6 @@ (( $+commands[apt] )) && APT=apt || APT=apt-get -alias acse='apt-cache search' +alias acs='apt-cache search' alias afs='apt-file search --regexp' diff --git a/themes/agnoster.zsh-theme b/themes/agnoster.zsh-theme index 88854eccd..aa274a5bb 100644 --- a/themes/agnoster.zsh-theme +++ b/themes/agnoster.zsh-theme @@ -109,7 +109,9 @@ prompt_git() { if [[ "$(git rev-parse --is-inside-work-tree 2>/dev/null)" = "true" ]]; then repo_path=$(git rev-parse --git-dir 2>/dev/null) dirty=$(parse_git_dirty) - ref=$(git symbolic-ref HEAD 2> /dev/null) || ref="➦ $(git rev-parse --short HEAD 2> /dev/null)" + ref=$(git symbolic-ref HEAD 2> /dev/null) || \ + ref="◈ $(git describe --exact-match --tags HEAD 2> /dev/null)" || \ + ref="➦ $(git rev-parse --short HEAD 2> /dev/null)" if [[ -n $dirty ]]; then prompt_segment yellow black else diff --git a/themes/fino-time.zsh-theme b/themes/fino-time.zsh-theme index c7e2d965e..3f9360ac5 100644 --- a/themes/fino-time.zsh-theme +++ b/themes/fino-time.zsh-theme @@ -12,6 +12,7 @@ # Also borrowing from http://stevelosh.com/blog/2010/02/my-extravagant-zsh-prompt/ function virtualenv_info { + [ $CONDA_DEFAULT_ENV ] && echo "($CONDA_DEFAULT_ENV) " [ $VIRTUAL_ENV ] && echo '('`basename $VIRTUAL_ENV`') ' } diff --git a/themes/michelebologna.zsh-theme b/themes/michelebologna.zsh-theme index bb86d68db..b13b2caf1 100644 --- a/themes/michelebologna.zsh-theme +++ b/themes/michelebologna.zsh-theme @@ -29,14 +29,13 @@ local cyan="%{$fg_bold[cyan]%}" local yellow="%{$fg_bold[yellow]%}" local blue="%{$fg_bold[blue]%}" local magenta="%{$fg_bold[magenta]%}" -local white="%{$fg_bold[white]%}" local reset="%{$reset_color%}" local -a color_array -color_array=($green $red $cyan $yellow $blue $magenta $white) +color_array=($green $red $cyan $yellow $blue $magenta) -local username_color=$white -local hostname_color=$color_array[$[((#HOST))%7+1]] # choose hostname color based on first character +local username_color=$blue +local hostname_color=$color_array[$[((#HOST))%6+1]] # choose hostname color based on first character local current_dir_color=$blue local username="%n" @@ -66,10 +65,10 @@ function michelebologna_git_prompt { local out=$(git_prompt_info)$(git_prompt_status)$(git_remote_status) [[ -n $out ]] || return printf " %s(%s%s%s)%s" \ - "%{$fg_bold[white]%}" \ + "%{$fg_bold[blue]%}" \ "%{$fg_bold[green]%}" \ "$out" \ - "%{$fg_bold[white]%}" \ + "%{$fg_bold[blue]%}" \ "%{$reset_color%}" }