From e585904e1040acedd2fc3092ef99a3a9aaa0d661 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A1n=20Ko=C5=A1=C4=8Do?= <3k.stanley@gmail.com> Date: Thu, 2 Jan 2014 00:35:19 +0100 Subject: [PATCH 01/22] Geeknote autocomplete and alias --- plugins/geeknote/_geeknote | 135 +++++++++++++++++++++++++++ plugins/geeknote/geeknote.plugin.zsh | 2 + 2 files changed, 137 insertions(+) create mode 100644 plugins/geeknote/_geeknote create mode 100644 plugins/geeknote/geeknote.plugin.zsh diff --git a/plugins/geeknote/_geeknote b/plugins/geeknote/_geeknote new file mode 100644 index 000000000000..4d5339f2b446 --- /dev/null +++ b/plugins/geeknote/_geeknote @@ -0,0 +1,135 @@ +#compdef geeknote +# --------------- ------------------------------------------------------------ +# Name : _geeknote +# Synopsis : zsh completion for geeknote +# Author : Ján Koščo <3k.stanley@gmail.com> +# HomePage : http://www.geeknote.me +# Version : 0.1 +# Tag : [ shell, zsh, completion, evernote ] +# Copyright : © 2014 by Ján Koščo, +# Released under current GPL license. +# --------------- ------------------------------------------------------------ + +local -a _1st_arguments +_1st_arguments=( + 'login' + 'logout' + 'settings' + 'create' + 'edit' + 'find' + 'show' + 'remove' + 'notebook-list' + 'notebook-create' + 'notebook-edit' + 'tag-list' + 'tag-create' + 'tag-edit' + 'gnsync' + 'user' +) + +_arguments '*:: :->command' + +if (( CURRENT == 1 )); then + _describe -t commands "geeknote command" _1st_arguments + return +fi + +local -a _command_args +case "$words[1]" in + user) + _command_args=( + '(--full)--full' \ + ) + ;; + logout) + _command_args=( + '(--force)--force' \ + ) + ;; + settings) + _command_args=( + '(--editor)--editor' \ + ) + ;; + create) + _command_args=( + '(-t|--title)'{-t,--title}'[note title]' \ + '(-c|--content)'{-c,--content}'[note content]' \ + '(-tg|--tags)'{-tg,--tags}'[one tag or the list of tags which will be added to the note]' \ + '(-nb|--notebook)'{-nb,--notebook}'[name of notebook where to save note]' \ + ) + ;; + edit) + _command_args=( + '(-n|--note)'{-n,--note}'[name or ID from the previous search of a note to edit]' \ + '(-t|--title)'{-t,--title}'[note title]' \ + '(-c|--content)'{-c,--content}'[note content]' \ + '(-tg|--tags)'{-tg,--tags}'[one tag or the list of tags which will be added to the note]' \ + '(-nb|--notebook)'{-nb,--notebook}'[name of notebook where to save note]' \ + ) + ;; + remove) + _command_args=( + '(-n|--note)'{-n,--note}'[name or ID from the previous search of a note to edit]' \ + '(--force)--force' \ + ) + ;; + show) + _command_args=( + '(-n|--note)'{-n,--note}'[name or ID from the previous search of a note to edit]' \ + ) + ;; + find) + _command_args=( + '(-s|--search)'{-s,--search}'[text to search]' \ + '(-tg|--tags)'{-tg,--tags}'[notes with which tag/tags to search]' \ + '(-nb|--notebook)'{-nb,--notebook}'[in which notebook search the note]' \ + '(-d|--date)'{-d,--date}'[date in format dd.mm.yyyy or date range dd.mm.yyyy-dd.mm.yyyy]' \ + '(-cn|--count)'{-cn,--count}'[how many notes show in the result list]' \ + '(-wu|--with-url)'{-wu,--with-url}'[add direct url of each note in results to Evernote web-version]' \ + '(-ee|--exact-entry)'{-ee,--exact-entry}'[search for exact entry of the request]' \ + '(-cs|--content-search)'{-cs,--content-search}'[search by content, not by title]' \ + ) + ;; + notebook-create) + _command_args=( + '(-t|--title)'{-t,--title}'[notebook title]' \ + ) + ;; + notebook-edit) + _command_args=( + '(-nb|--notebook)'{-nb,--notebook}'[name of notebook to rename]' \ + '(-t|--title)'{-t,--title}'[new notebook title]' \ + ) + ;; + notebook-remove) + _command_args=( + '(-nb|--notebook)'{-nb,--notebook}'[name of notebook to remove]' \ + '(--force)--force' \ + ) + ;; + tag-create) + _command_args=( + '(-t|--title)'{-t,--title}'[title of tag]' \ + ) + ;; + tag-create) + _command_args=( + '(-tgn|--tagname)'{-tgn,--tagname}'[tag to edit]' \ + '(-t|--title)'{-t,--title}'[new tag name]' \ + ) + ;; + tag-remove) + _command_args=( + '(-tgn|--tagname)'{-tgn,--tagname}'[tag to remove]' \ + '(--force)--force' \ + ) + ;; + esac + +_arguments \ + $_command_args \ + && return 0 diff --git a/plugins/geeknote/geeknote.plugin.zsh b/plugins/geeknote/geeknote.plugin.zsh new file mode 100644 index 000000000000..8126d26b33e0 --- /dev/null +++ b/plugins/geeknote/geeknote.plugin.zsh @@ -0,0 +1,2 @@ +#Alias +alias gn='geeknote' From aac85f095e302c72b109801063da8d8c4d13af3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A1n=20Ko=C5=A1=C4=8Do?= <3k.stanley@gmail.com> Date: Fri, 22 Aug 2014 23:11:52 +0200 Subject: [PATCH 02/22] Proper handling of tags --- plugins/geeknote/_geeknote | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/geeknote/_geeknote b/plugins/geeknote/_geeknote index 4d5339f2b446..2d1188e8420b 100644 --- a/plugins/geeknote/_geeknote +++ b/plugins/geeknote/_geeknote @@ -26,6 +26,7 @@ _1st_arguments=( 'tag-list' 'tag-create' 'tag-edit' + 'tag-remove' 'gnsync' 'user' ) @@ -116,7 +117,7 @@ case "$words[1]" in '(-t|--title)'{-t,--title}'[title of tag]' \ ) ;; - tag-create) + tag-edit) _command_args=( '(-tgn|--tagname)'{-tgn,--tagname}'[tag to edit]' \ '(-t|--title)'{-t,--title}'[new tag name]' \ From b3d27be944c36b15900c9e11a6d1495096d43ba1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A1n=20Ko=C5=A1=C4=8Do?= <3k.stanley@gmail.com> Date: Fri, 22 Aug 2014 23:12:02 +0200 Subject: [PATCH 03/22] Update seach parameter --- plugins/geeknote/_geeknote | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/geeknote/_geeknote b/plugins/geeknote/_geeknote index 2d1188e8420b..cf1a187d252b 100644 --- a/plugins/geeknote/_geeknote +++ b/plugins/geeknote/_geeknote @@ -90,7 +90,7 @@ case "$words[1]" in '(-nb|--notebook)'{-nb,--notebook}'[in which notebook search the note]' \ '(-d|--date)'{-d,--date}'[date in format dd.mm.yyyy or date range dd.mm.yyyy-dd.mm.yyyy]' \ '(-cn|--count)'{-cn,--count}'[how many notes show in the result list]' \ - '(-wu|--with-url)'{-wu,--with-url}'[add direct url of each note in results to Evernote web-version]' \ + '(-uo|--url-only)'{-uo,--url-only}'[add direct url of each note in results to Evernote web-version]' \ '(-ee|--exact-entry)'{-ee,--exact-entry}'[search for exact entry of the request]' \ '(-cs|--content-search)'{-cs,--content-search}'[search by content, not by title]' \ ) From a6ab704482f3f092b907a306eec2b3b8d908a5da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A1n=20Ko=C5=A1=C4=8Do?= <3k.stanley@gmail.com> Date: Mon, 1 Sep 2014 20:08:29 +0200 Subject: [PATCH 04/22] Added a short description of the plugin --- plugins/geeknote/README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 plugins/geeknote/README.md diff --git a/plugins/geeknote/README.md b/plugins/geeknote/README.md new file mode 100644 index 000000000000..a6b50e27f0a7 --- /dev/null +++ b/plugins/geeknote/README.md @@ -0,0 +1,12 @@ +## ZSH-Geeknote + +[Geeknote](https://github.com/VitaliyRodnenko/geeknote) plugin for [oh-my-zsh framework](http://github.com/robbyrussell/oh-my-zsh). + +Plugins provides: + +- auto completion of commands and their options +- alias `gn` + +You can find information how to install Geeknote and it's available commands on the [project website](http://www.geeknote.me/). + +Maintainer : Ján Koščo ([@s7anley](https://twitter.com/s7anley)) From e2bf7cb3dfcbe42686beb038035d9870eeb0faa3 Mon Sep 17 00:00:00 2001 From: isqua Date: Sat, 26 Apr 2014 02:44:02 +0400 Subject: [PATCH 05/22] Fix checkmark for clean repo in bureau theme --- themes/bureau.zsh-theme | 58 ++++++++++++++++++++++------------------- 1 file changed, 31 insertions(+), 27 deletions(-) diff --git a/themes/bureau.zsh-theme b/themes/bureau.zsh-theme index 148abec10e9c..c6296500d06b 100644 --- a/themes/bureau.zsh-theme +++ b/themes/bureau.zsh-theme @@ -23,31 +23,35 @@ bureau_git_branch () { } bureau_git_status () { - _INDEX=$(command git status --porcelain -b 2> /dev/null) _STATUS="" - if $(echo "$_INDEX" | grep '^[AMRD]. ' &> /dev/null); then - _STATUS="$_STATUS$ZSH_THEME_GIT_PROMPT_STAGED" - fi - if $(echo "$_INDEX" | grep '^.[MTD] ' &> /dev/null); then - _STATUS="$_STATUS$ZSH_THEME_GIT_PROMPT_UNSTAGED" - fi - if $(echo "$_INDEX" | command grep -E '^\?\? ' &> /dev/null); then - _STATUS="$_STATUS$ZSH_THEME_GIT_PROMPT_UNTRACKED" - fi - if $(echo "$_INDEX" | grep '^UU ' &> /dev/null); then - _STATUS="$_STATUS$ZSH_THEME_GIT_PROMPT_UNMERGED" - fi - if $(command git rev-parse --verify refs/stash >/dev/null 2>&1); then - _STATUS="$_STATUS$ZSH_THEME_GIT_PROMPT_STASHED" - fi - if $(echo "$_INDEX" | grep '^## .*ahead' &> /dev/null); then - _STATUS="$_STATUS$ZSH_THEME_GIT_PROMPT_AHEAD" - fi - if $(echo "$_INDEX" | grep '^## .*behind' &> /dev/null); then - _STATUS="$_STATUS$ZSH_THEME_GIT_PROMPT_BEHIND" - fi - if $(echo "$_INDEX" | grep '^## .*diverged' &> /dev/null); then - _STATUS="$_STATUS$ZSH_THEME_GIT_PROMPT_DIVERGED" + if [[ $(command git status --short 2> /dev/null) != "" ]]; then + _INDEX=$(command git status --porcelain -b 2> /dev/null) + if $(echo "$_INDEX" | command grep '^[AMRD]. ' &> /dev/null); then + _STATUS="$_STATUS$ZSH_THEME_GIT_PROMPT_STAGED" + fi + if $(echo "$_INDEX" | command grep '^.[MTD] ' &> /dev/null); then + _STATUS="$_STATUS$ZSH_THEME_GIT_PROMPT_UNSTAGED" + fi + if $(echo "$_INDEX" | command grep -E '^\?\? ' &> /dev/null); then + _STATUS="$_STATUS$ZSH_THEME_GIT_PROMPT_UNTRACKED" + fi + if $(echo "$_INDEX" | command grep '^UU ' &> /dev/null); then + _STATUS="$_STATUS$ZSH_THEME_GIT_PROMPT_UNMERGED" + fi + if $(command git rev-parse --verify refs/stash >/dev/null 2>&1); then + _STATUS="$_STATUS$ZSH_THEME_GIT_PROMPT_STASHED" + fi + if $(echo "$_INDEX" | command grep '^## .*ahead' &> /dev/null); then + _STATUS="$_STATUS$ZSH_THEME_GIT_PROMPT_AHEAD" + fi + if $(echo "$_INDEX" | command grep '^## .*behind' &> /dev/null); then + _STATUS="$_STATUS$ZSH_THEME_GIT_PROMPT_BEHIND" + fi + if $(echo "$_INDEX" | command grep '^## .*diverged' &> /dev/null); then + _STATUS="$_STATUS$ZSH_THEME_GIT_PROMPT_DIVERGED" + fi + else + _STATUS="$_STATUS$ZSH_THEME_GIT_PROMPT_CLEAN" fi echo $_STATUS @@ -84,10 +88,10 @@ _LIBERTY="$_LIBERTY%{$reset_color%}" get_space () { local STR=$1$2 local zero='%([BSUbfksu]|([FB]|){*})' - local LENGTH=${#${(S%%)STR//$~zero/}} + local LENGTH=${#${(S%%)STR//$~zero/}} local SPACES="" (( LENGTH = ${COLUMNS} - $LENGTH - 1)) - + for i in {0..$LENGTH} do SPACES="$SPACES " @@ -101,7 +105,7 @@ _1RIGHT="[%*] " bureau_precmd () { _1SPACES=`get_space $_1LEFT $_1RIGHT` - print + print print -rP "$_1LEFT$_1SPACES$_1RIGHT" } From a1ed87a8a1a51f2b2363677a6f6f8d841566176c Mon Sep 17 00:00:00 2001 From: delphiki Date: Wed, 13 May 2015 16:55:54 +0200 Subject: [PATCH 06/22] Added environment based shortcuts in symfony2 plugin --- plugins/symfony2/symfony2.plugin.zsh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/symfony2/symfony2.plugin.zsh b/plugins/symfony2/symfony2.plugin.zsh index e94280ed075c..8f104b53e654 100644 --- a/plugins/symfony2/symfony2.plugin.zsh +++ b/plugins/symfony2/symfony2.plugin.zsh @@ -25,3 +25,5 @@ alias sfcw='sf cache:warmup' alias sfroute='sf router:debug' alias sfcontainer='sf container:debug' alias sfgb='sf generate:bundle' +alias dev="sf --env=dev" +alias prod="sf --env=prod" From 68e03a05923b65b0a0272f251ea1e72e3540f827 Mon Sep 17 00:00:00 2001 From: ju Date: Tue, 16 Jun 2015 08:44:50 +0200 Subject: [PATCH 07/22] Changed env based sf2 shortcuts to sfdev & sfprod --- plugins/symfony2/symfony2.plugin.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/symfony2/symfony2.plugin.zsh b/plugins/symfony2/symfony2.plugin.zsh index 8f104b53e654..aa7eb4cc28f5 100644 --- a/plugins/symfony2/symfony2.plugin.zsh +++ b/plugins/symfony2/symfony2.plugin.zsh @@ -25,5 +25,5 @@ alias sfcw='sf cache:warmup' alias sfroute='sf router:debug' alias sfcontainer='sf container:debug' alias sfgb='sf generate:bundle' -alias dev="sf --env=dev" -alias prod="sf --env=prod" +alias sfdev='sf --env=dev' +alias sfprod='sf --env=prod' From e66afc031833590d6077c029596f251ed247158a Mon Sep 17 00:00:00 2001 From: aioute Gao Date: Mon, 2 Nov 2015 16:12:38 +0900 Subject: [PATCH 08/22] Avoid using "PREFIX" that cause nvm to complain about. --- themes/sunrise.zsh-theme | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/themes/sunrise.zsh-theme b/themes/sunrise.zsh-theme index 28befd01b505..9b9259a2ded0 100644 --- a/themes/sunrise.zsh-theme +++ b/themes/sunrise.zsh-theme @@ -11,9 +11,9 @@ B=$fg_no_bold[blue] RESET=$reset_color if [ "$USER" = "root" ]; then - PROMPTCOLOR="%{$R%}" PREFIX="-!-"; + PROMPTCOLOR="%{$R%}" PROMPTPREFIX="-!-"; else - PROMPTCOLOR="" PREFIX="---"; + PROMPTCOLOR="" PROMPTPREFIX="---"; fi local return_code="%(?..%{$R%}%? ↵%{$RESET%})" @@ -67,7 +67,7 @@ function custom_git_prompt() { } # %B sets bold text -PROMPT='%B$PREFIX %2~ $(custom_git_prompt)%{$M%}%B»%b%{$RESET%} ' +PROMPT='%B$PROMPTPREFIX %2~ $(custom_git_prompt)%{$M%}%B»%b%{$RESET%} ' RPS1="${return_code}" ZSH_THEME_GIT_PROMPT_PREFIX="%{$Y%}‹" From d853ec4b629f24c6622f414f312fbf83cec0990d Mon Sep 17 00:00:00 2001 From: atk91 Date: Fri, 25 Dec 2015 11:33:29 +0300 Subject: [PATCH 09/22] Closes #4727 --- plugins/git/git.plugin.zsh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh index b851fb97da21..262f5b2ec078 100644 --- a/plugins/git/git.plugin.zsh +++ b/plugins/git/git.plugin.zsh @@ -146,15 +146,15 @@ alias gke='\gitk --all $(git log -g --pretty=format:%h)' compdef _git gke='gitk' alias gl='git pull' -alias glg='git log --stat --color' -alias glgp='git log --stat --color -p' -alias glgg='git log --graph --color' +alias glg='git log --stat' +alias glgp='git log --stat -p' +alias glgg='git log --graph' alias glgga='git log --graph --decorate --all' alias glgm='git log --graph --max-count=10' -alias glo='git log --oneline --decorate --color' +alias glo='git log --oneline --decorate' alias glol="git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit" alias glola="git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --all" -alias glog='git log --oneline --decorate --color --graph' +alias glog='git log --oneline --decorate --graph' alias glp="_git_log_prettily" compdef _git glp=git-log From a6ad7a0c8d3a2d4be5ad0d70358c4bdbe47ace9b Mon Sep 17 00:00:00 2001 From: Anton Rieder Date: Fri, 29 Jan 2016 13:04:53 +0100 Subject: [PATCH 10/22] Add missing alias to README of bundler plugin --- plugins/bundler/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/bundler/README.md b/plugins/bundler/README.md index edd95ccc23a3..04d55144757f 100644 --- a/plugins/bundler/README.md +++ b/plugins/bundler/README.md @@ -6,6 +6,7 @@ - `bl` aliased to `bundle list` - `bp` aliased to `bundle package` - `bo` aliased to `bundle open` + - `bout` aliased to `bundle outdated` - `bu` aliased to `bundle update` - `bi` aliased to `bundle install --jobs=` (only for bundler `>= 1.4.0`) - adds a wrapper for common gems: From eee6f08421c0fad26cef0b5e7fca75753ddd84b8 Mon Sep 17 00:00:00 2001 From: Gautam Kotian Date: Mon, 15 Feb 2016 10:51:17 +0100 Subject: [PATCH 11/22] Minor README fixes --- plugins/github/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/github/README.md b/plugins/github/README.md index 21b7367f736b..fea60787643b 100644 --- a/plugins/github/README.md +++ b/plugins/github/README.md @@ -1,6 +1,6 @@ # github -This plugin supports working with GitHub the command line. It provides a few things: +This plugin supports working with GitHub from the command line. It provides a few things: * Sets up the `hub` wrapper and completions for the `git` command if you have `hub` installed. * Completion for the `github` Ruby gem. @@ -37,7 +37,7 @@ See `man hub` for more details. ### Homebrew installation note -If you have installed `hub` using Homebrew, its completions may not be on your `$FPATH` if you are using the system `zsh`. Homebrew installs `zsh` completion definitions to `/usr/local/share/zsh/site-functions`, which on `$FPATH` for the Homebrew-installed `zsh`, but not for the system `zsh`. If you want it to work with the system `zsh`, add this to your `~/.zshrc` before it sources `oh-my-zsh.sh`. +If you have installed `hub` using Homebrew, its completions may not be on your `$FPATH` if you are using the system `zsh`. Homebrew installs `zsh` completion definitions to `/usr/local/share/zsh/site-functions`, which will be on `$FPATH` for the Homebrew-installed `zsh`, but not for the system `zsh`. If you want it to work with the system `zsh`, add this to your `~/.zshrc` before it sources `oh-my-zsh.sh`. ```zsh if (( ! ${fpath[(I)/usr/local/share/zsh/site-functions]} )); then From 8ac1859f377b5292597f11f5973bae1ebc8e2dce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Sat, 19 Mar 2016 20:46:36 +0100 Subject: [PATCH 12/22] Update GitHub download URLs in README From `raw.github.com' to `raw.githubusercontent.com' Fixes #4933 --- README.markdown | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.markdown b/README.markdown index 843c0c6ba0b8..b7d304116c2c 100644 --- a/README.markdown +++ b/README.markdown @@ -26,13 +26,13 @@ Oh My Zsh is installed by running one of the following commands in your terminal #### via curl ```shell -sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" +sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" ``` #### via wget ```shell -sh -c "$(wget https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)" +sh -c "$(wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)" ``` ## Using Oh My Zsh From 097cc70f7bf375b8ed9cff73e0c23e5dabd825c7 Mon Sep 17 00:00:00 2001 From: "Antonis Karamitros @antouank" Date: Thu, 24 Mar 2016 07:28:26 +0000 Subject: [PATCH 13/22] [feature/npm-outdated] - add alias for "npm outdated" to check outdated npm modules --- plugins/npm/npm.plugin.zsh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugins/npm/npm.plugin.zsh b/plugins/npm/npm.plugin.zsh index 3f6fe0fb345b..38e699ea0197 100644 --- a/plugins/npm/npm.plugin.zsh +++ b/plugins/npm/npm.plugin.zsh @@ -17,3 +17,6 @@ alias npmD="npm i -D " # Execute command from node_modules folder based on current directory # i.e npmE gulp alias npmE='PATH="$(npm bin)":"$PATH"' + +# Check which npm modules are outdated +alias npmO="npm outdated" From 9cc3e8bf29f08f89279ee1e2e86f89759c02ad4f Mon Sep 17 00:00:00 2001 From: Yad Smood Date: Thu, 24 Mar 2016 15:29:24 +0800 Subject: [PATCH 14/22] Optimize the ys.zsh-theme make it simpler --- themes/ys.zsh-theme | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/themes/ys.zsh-theme b/themes/ys.zsh-theme index 737b506beb4b..89d5355dc952 100644 --- a/themes/ys.zsh-theme +++ b/themes/ys.zsh-theme @@ -35,16 +35,16 @@ ys_hg_prompt_info() { fi } -local exit_code="%(?,%?,%{$fg[red]%}%?%{$reset_color%})" +local exit_code="%(?,,C:%{$fg[red]%}%?%{$reset_color%})" # Prompt format: # -# PRIVILEGES USER @ MACHINE in DIRECTORY on git:BRANCH STATE [TIME] tty:$TTY L:$SHELL_LEVEL N:LINE_NUM C:LAST_EXIT_CODE +# PRIVILEGES USER @ MACHINE in DIRECTORY on git:BRANCH STATE [TIME] C:LAST_EXIT_CODE # $ COMMAND # # For example: # -# % ys @ ys-mbp in ~/.oh-my-zsh on git:master x [21:47:42] tty:s000 L:1 N:12 C:0 +# % ys @ ys-mbp in ~/.oh-my-zsh on git:master x [21:47:42] C:0 # $ PROMPT=" %{$terminfo[bold]$fg[blue]%}#%{$reset_color%} \ @@ -56,5 +56,5 @@ PROMPT=" ${hg_info}\ ${git_info}\ \ -%{$fg[white]%}[%*] tty:%l L:%L N:%i C:$exit_code +%{$fg[white]%}[%*] $exit_code %{$terminfo[bold]$fg[red]%}$ %{$reset_color%}" From e0246ed5b7c210d4a395a77a5befb44248501989 Mon Sep 17 00:00:00 2001 From: Aaron Brager Date: Thu, 24 Mar 2016 10:53:49 -0500 Subject: [PATCH 15/22] Remove "Mac" from "Mac OS X" --- README.markdown | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.markdown b/README.markdown index b7d304116c2c..ca18bc9bae9b 100644 --- a/README.markdown +++ b/README.markdown @@ -12,9 +12,9 @@ To learn more, visit [ohmyz.sh](http://ohmyz.sh) and follow [@ohmyzsh](https://t ### Prerequisites -__Disclaimer:__ _Oh My Zsh works best on Mac OS X and Linux._ +__Disclaimer:__ _Oh My Zsh works best on OS X and Linux._ -* Unix-based operating system (Mac OS X or Linux) +* Unix-based operating system (OS X or Linux) * [Zsh](http://www.zsh.org) should be installed (v4.3.9 or more recent). If not pre-installed (`zsh --version` to confirm), check the following instruction here: [Installing ZSH](https://github.com/robbyrussell/oh-my-zsh/wiki/Installing-ZSH) * `curl` or `wget` should be installed * `git` should be installed From 186f009ecc2362bb8c44eacfdd0adaa27f6b866a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Thu, 24 Mar 2016 23:34:41 +0100 Subject: [PATCH 16/22] Update README.markdown --- README.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.markdown b/README.markdown index ca18bc9bae9b..0cbea72c9b6d 100644 --- a/README.markdown +++ b/README.markdown @@ -104,7 +104,7 @@ The default location is `~/.oh-my-zsh` (hidden in your home directory) 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 like this: ```shell -export ZSH="$HOME/.dotfiles/oh-my-zsh"; sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" +export ZSH="$HOME/.dotfiles/oh-my-zsh"; sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" ``` #### Manual Installation From fc897734138475ac3a6548b856ddf4741ef40c07 Mon Sep 17 00:00:00 2001 From: Matthew Lewin Date: Fri, 25 Mar 2016 11:57:09 -0700 Subject: [PATCH 17/22] Update 'tm' function to take multiple files on the command-line --- plugins/textmate/textmate.plugin.zsh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/plugins/textmate/textmate.plugin.zsh b/plugins/textmate/textmate.plugin.zsh index 02813de9e6bb..17451101931d 100644 --- a/plugins/textmate/textmate.plugin.zsh +++ b/plugins/textmate/textmate.plugin.zsh @@ -1,13 +1,14 @@ # If the tm command is called without an argument, open TextMate in the current directory # If tm is passed a directory, cd to it and open it in TextMate -# If tm is passed a file, open it in TextMate +# If tm is passed anything else (i.e., a list of files and/or options), pass them all along +# This allows easy opening of multiple files. function tm() { if [[ -z $1 ]]; then mate . - else + elif [[ -d $1 ]]; then mate $1 - if [[ -d $1 ]]; then - cd $1 - fi + cd $1 + else + mate "$@" fi } From 616ac67924212df2f75139c94ca323f13f249dc6 Mon Sep 17 00:00:00 2001 From: Rob Loach Date: Wed, 30 Mar 2016 02:05:07 -0400 Subject: [PATCH 18/22] Add 'asdf' plugin --- plugins/asdf/README.md | 27 +++++++++++++++++++++++++++ plugins/asdf/asdf.plugin.zsh | 7 +++++++ 2 files changed, 34 insertions(+) create mode 100644 plugins/asdf/README.md create mode 100644 plugins/asdf/asdf.plugin.zsh diff --git a/plugins/asdf/README.md b/plugins/asdf/README.md new file mode 100644 index 000000000000..e8aa976bca3f --- /dev/null +++ b/plugins/asdf/README.md @@ -0,0 +1,27 @@ +## asdf + +**Maintainer:** [@RobLoach](https://github.com/RobLoach) + +Adds integration with [asdf](https://github.com/asdf-vm/asdf), the extendable version manager, with support for Ruby, Node.js, Elixir, Erlang and more. + +### Installation + +1. Enable the plugin by adding it to your `plugins` definition in `~/.zshrc`. + + ``` + plugins=(asdf) + ``` + +2. [Install asdf](https://github.com/asdf-vm/asdf#setup) by running the following: + ``` + git clone https://github.com/asdf-vm/asdf.git ~/.asdf + ``` + +### Usage + +See the [asdf usage documentation](https://github.com/asdf-vm/asdf#usage) for information on how to use asdf: + +``` +asdf plugin-add nodejs git@github.com:asdf-vm/asdf-nodejs.git +asdf install nodejs 5.9.1 +``` diff --git a/plugins/asdf/asdf.plugin.zsh b/plugins/asdf/asdf.plugin.zsh new file mode 100644 index 000000000000..8736d2ff8363 --- /dev/null +++ b/plugins/asdf/asdf.plugin.zsh @@ -0,0 +1,7 @@ +# Find where asdf should be installed. +ASDF_DIR="${ASDF_DIR:-$HOME/.asdf}" + +# Load asdf, if found. +if [ -f $ASDF_DIR/asdf.sh ]; then + . $ASDF_DIR/asdf.sh +fi From e8a9d0ee1a97033fb4aa371263889b77200b6d62 Mon Sep 17 00:00:00 2001 From: "Jon-Erik Johnzon (TorrentKatten)" Date: Wed, 30 Mar 2016 21:46:39 +0200 Subject: [PATCH 19/22] localization support for clock in candy theme Now uses 12-hour clock or 24-hour clock depending on user locale --- themes/candy.zsh-theme | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/candy.zsh-theme b/themes/candy.zsh-theme index bc125c5ce140..40e6d411e616 100644 --- a/themes/candy.zsh-theme +++ b/themes/candy.zsh-theme @@ -1,4 +1,4 @@ -PROMPT=$'%{$fg_bold[green]%}%n@%m %{$fg[blue]%}%D{[%I:%M:%S]} %{$reset_color%}%{$fg[white]%}[%~]%{$reset_color%} $(git_prompt_info)\ +PROMPT=$'%{$fg_bold[green]%}%n@%m %{$fg[blue]%}%D{[%X]} %{$reset_color%}%{$fg[white]%}[%~]%{$reset_color%} $(git_prompt_info)\ %{$fg[blue]%}->%{$fg_bold[blue]%} %#%{$reset_color%} ' ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[green]%}[" From 69e1506ad9fed9771b9f7d1e478ac2ff05fc3604 Mon Sep 17 00:00:00 2001 From: Aesop Wolf Date: Thu, 31 Mar 2016 14:16:46 -0700 Subject: [PATCH 20/22] Add git user profile functions for prompt display --- lib/git.zsh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lib/git.zsh b/lib/git.zsh index f91b516bd38a..1c76d58829ba 100644 --- a/lib/git.zsh +++ b/lib/git.zsh @@ -188,6 +188,18 @@ function git_compare_version() { echo 0 } +# 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 +} + +# 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 +} + # This is unlikely to change so make it all statically assigned POST_1_7_2_GIT=$(git_compare_version "1.7.2") # Clean up the namespace slightly by removing the checker function From e1b04cfecd87d1e39656be07df8f73a4ea113b8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Mon, 4 Apr 2016 20:39:10 +0200 Subject: [PATCH 21/22] Fix logic of bureau_git_status function This separates the gathering of file status, repository status and stash. --- themes/bureau.zsh-theme | 36 +++++++++++++++++++++--------------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/themes/bureau.zsh-theme b/themes/bureau.zsh-theme index c6296500d06b..9b1759c1b329 100644 --- a/themes/bureau.zsh-theme +++ b/themes/bureau.zsh-theme @@ -22,10 +22,12 @@ bureau_git_branch () { echo "${ref#refs/heads/}" } -bureau_git_status () { +bureau_git_status() { _STATUS="" - if [[ $(command git status --short 2> /dev/null) != "" ]]; then - _INDEX=$(command git status --porcelain -b 2> /dev/null) + + # check status of files + _INDEX=$(command git status --porcelain 2> /dev/null) + if [[ -n "$_INDEX" ]]; then if $(echo "$_INDEX" | command grep '^[AMRD]. ' &> /dev/null); then _STATUS="$_STATUS$ZSH_THEME_GIT_PROMPT_STAGED" fi @@ -38,22 +40,26 @@ bureau_git_status () { if $(echo "$_INDEX" | command grep '^UU ' &> /dev/null); then _STATUS="$_STATUS$ZSH_THEME_GIT_PROMPT_UNMERGED" fi - if $(command git rev-parse --verify refs/stash >/dev/null 2>&1); then - _STATUS="$_STATUS$ZSH_THEME_GIT_PROMPT_STASHED" - fi - if $(echo "$_INDEX" | command grep '^## .*ahead' &> /dev/null); then - _STATUS="$_STATUS$ZSH_THEME_GIT_PROMPT_AHEAD" - fi - if $(echo "$_INDEX" | command grep '^## .*behind' &> /dev/null); then - _STATUS="$_STATUS$ZSH_THEME_GIT_PROMPT_BEHIND" - fi - if $(echo "$_INDEX" | command grep '^## .*diverged' &> /dev/null); then - _STATUS="$_STATUS$ZSH_THEME_GIT_PROMPT_DIVERGED" - fi else _STATUS="$_STATUS$ZSH_THEME_GIT_PROMPT_CLEAN" fi + # check status of local repository + _INDEX=$(command git status --porcelain -b 2> /dev/null) + if $(echo "$_INDEX" | command grep '^## .*ahead' &> /dev/null); then + _STATUS="$_STATUS$ZSH_THEME_GIT_PROMPT_AHEAD" + fi + if $(echo "$_INDEX" | command grep '^## .*behind' &> /dev/null); then + _STATUS="$_STATUS$ZSH_THEME_GIT_PROMPT_BEHIND" + fi + if $(echo "$_INDEX" | command grep '^## .*diverged' &> /dev/null); then + _STATUS="$_STATUS$ZSH_THEME_GIT_PROMPT_DIVERGED" + fi + + if $(command git rev-parse --verify refs/stash &> /dev/null); then + _STATUS="$_STATUS$ZSH_THEME_GIT_PROMPT_STASHED" + fi + echo $_STATUS } From 82a4587427ea8246bf74858ace489c81690c3c28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Mon, 4 Apr 2016 23:06:08 +0200 Subject: [PATCH 22/22] Use `grep -q` for silent behavior --- themes/bureau.zsh-theme | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/themes/bureau.zsh-theme b/themes/bureau.zsh-theme index 9b1759c1b329..3b3bdc80f318 100644 --- a/themes/bureau.zsh-theme +++ b/themes/bureau.zsh-theme @@ -28,16 +28,16 @@ bureau_git_status() { # check status of files _INDEX=$(command git status --porcelain 2> /dev/null) if [[ -n "$_INDEX" ]]; then - if $(echo "$_INDEX" | command grep '^[AMRD]. ' &> /dev/null); then + if $(echo "$_INDEX" | command grep -q '^[AMRD]. '); then _STATUS="$_STATUS$ZSH_THEME_GIT_PROMPT_STAGED" fi - if $(echo "$_INDEX" | command grep '^.[MTD] ' &> /dev/null); then + if $(echo "$_INDEX" | command grep -q '^.[MTD] '); then _STATUS="$_STATUS$ZSH_THEME_GIT_PROMPT_UNSTAGED" fi - if $(echo "$_INDEX" | command grep -E '^\?\? ' &> /dev/null); then + if $(echo "$_INDEX" | command grep -q -E '^\?\? '); then _STATUS="$_STATUS$ZSH_THEME_GIT_PROMPT_UNTRACKED" fi - if $(echo "$_INDEX" | command grep '^UU ' &> /dev/null); then + if $(echo "$_INDEX" | command grep -q '^UU '); then _STATUS="$_STATUS$ZSH_THEME_GIT_PROMPT_UNMERGED" fi else @@ -46,13 +46,13 @@ bureau_git_status() { # check status of local repository _INDEX=$(command git status --porcelain -b 2> /dev/null) - if $(echo "$_INDEX" | command grep '^## .*ahead' &> /dev/null); then + if $(echo "$_INDEX" | command grep -q '^## .*ahead'); then _STATUS="$_STATUS$ZSH_THEME_GIT_PROMPT_AHEAD" fi - if $(echo "$_INDEX" | command grep '^## .*behind' &> /dev/null); then + if $(echo "$_INDEX" | command grep -q '^## .*behind'); then _STATUS="$_STATUS$ZSH_THEME_GIT_PROMPT_BEHIND" fi - if $(echo "$_INDEX" | command grep '^## .*diverged' &> /dev/null); then + if $(echo "$_INDEX" | command grep -q '^## .*diverged'); then _STATUS="$_STATUS$ZSH_THEME_GIT_PROMPT_DIVERGED" fi