From d97295c183808d376f86166bed7613cee1742528 Mon Sep 17 00:00:00 2001 From: Carlo Dapor Date: Fri, 12 Aug 2016 20:50:57 +0200 Subject: [PATCH 01/56] Added angular-cli (ng) completion. --- plugins/ng/ng.plugin.zsh | 73 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 plugins/ng/ng.plugin.zsh diff --git a/plugins/ng/ng.plugin.zsh b/plugins/ng/ng.plugin.zsh new file mode 100644 index 000000000..8e9b4ab16 --- /dev/null +++ b/plugins/ng/ng.plugin.zsh @@ -0,0 +1,73 @@ + +ng_opts='addon asset-sizes b build completion d destroy doc e2e g generate get h help i init install lint make-this-awesome new s serve server set t test v version -h --help' + +_ng_completion () { + local words cword opts + read -Ac words + read -cn cword + let cword-=1 + + case $words[cword] in + addon ) + opts='-b --blueprint -d -dir --directory --dry-run -sb --skip-bower -sg --skip-git -sn --skip-npm -v --verbose' + ;; + + asset-sizes ) + opts='-o --output-path' + ;; + + i | install) + opts='' + ;; + + b | build ) + opts='--environment --output-path --suppress-sizes --watch --watcher -dev -e -prod' + ;; + + d | destroy ) + opts='--dry-run --verbose --pod --classic --dummy --in-repo --in-repo-addon -d -v -p -c -dum -id -ir' + ;; + + g | generate ) + opts='component directive pipe route service --generate -d --dry-run --verbose -v --pod -p --classic -c --dummy -dum -id --in-repo --in-repo-addon -ir' + ;; + + h | help | -h | --help) + opts='--json --verbose -v' + ;; + + init ) + opts='--blueprint --dry-run --link-cli --mobile --name --prefix --skip-bower --skip-npm --source-dir --style --verbose -b -d -lc -n -p -sb -sd -sn -v' + ;; + + new ) + opts='--blueprint --directory --dry-run --link-cli --mobile --prefix --skip-bower --skip-git --skip-npm --source-dir --style --verbose -b -d -dir -lc -p -sb -sd -sg -sn -v' + ;; + + s | serve | server ) + opts='--environment --host --insecure-proxy --inspr --live-reload --live-reload-host --live-reload-port --output-path --port --proxy --ssl --ssl-cert --ssl-key --watcher -H -dev -e -lr -lrbu -lrh -lrp -op -out -p -pr -prod -pxy -w' + ;; + + set ) + opts='--global -g' + ;; + + t | test ) + opts='--browsers --colors --config-file --environment --filter --host --launch --log-level --module --path --port --query --reporter --server --silent --test-page --test-port --watch -H -c -cf -e -f -m -r -s -tp -w' + ;; + + v | version ) + opts='--verbose' + ;; + + ng | *) + opts=$ng_opts + ;; + esac + + setopt shwordsplit + reply=($opts) + unset shwordsplit +} + +compctl -K _ng_completion ng From eb6c7a4f409eeca1a263a9e765ffa3d5da362ccc Mon Sep 17 00:00:00 2001 From: Carlo Dapor Date: Fri, 12 Aug 2016 21:01:51 +0200 Subject: [PATCH 02/56] The argument completion also has no extra options. --- plugins/ng/ng.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/ng/ng.plugin.zsh b/plugins/ng/ng.plugin.zsh index 8e9b4ab16..ce34c8b54 100644 --- a/plugins/ng/ng.plugin.zsh +++ b/plugins/ng/ng.plugin.zsh @@ -16,7 +16,7 @@ _ng_completion () { opts='-o --output-path' ;; - i | install) + completion | i | install) opts='' ;; From 093440ee4f3c8d4df1fcbb021699ab30d468f6be Mon Sep 17 00:00:00 2001 From: Carlo Dapor Date: Fri, 12 Aug 2016 23:43:19 +0200 Subject: [PATCH 03/56] Updated options for generate. Added gh-pages:deploy / github-pages:deploy. --- plugins/ng/ng.plugin.zsh | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/plugins/ng/ng.plugin.zsh b/plugins/ng/ng.plugin.zsh index ce34c8b54..2488bc230 100644 --- a/plugins/ng/ng.plugin.zsh +++ b/plugins/ng/ng.plugin.zsh @@ -1,5 +1,5 @@ -ng_opts='addon asset-sizes b build completion d destroy doc e2e g generate get h help i init install lint make-this-awesome new s serve server set t test v version -h --help' +ng_opts='addon asset-sizes b build completion d destroy doc e2e g generate get github-pages:deploy gh-pages:deploy h help i init install lint make-this-awesome new s serve server set t test v version -h --help' _ng_completion () { local words cword opts @@ -16,12 +16,8 @@ _ng_completion () { opts='-o --output-path' ;; - completion | i | install) - opts='' - ;; - b | build ) - opts='--environment --output-path --suppress-sizes --watch --watcher -dev -e -prod' + opts='--environment --output-path --suppress-sizes --target --watch --watcher -dev -e -prod' ;; d | destroy ) @@ -29,7 +25,11 @@ _ng_completion () { ;; g | generate ) - opts='component directive pipe route service --generate -d --dry-run --verbose -v --pod -p --classic -c --dummy -dum -id --in-repo --in-repo-addon -ir' + opts='class component directive enum module pipe route service --generate -d --dry-run --verbose -v --pod -p --classic -c --dummy -dum -id --in-repo --in-repo-addon -ir' + ;; + + gh-pages:deploy | github-pages:deploy ) + opts='--environment --gh-token --gh-username --skip-build --user-page --message' ;; h | help | -h | --help) @@ -45,7 +45,7 @@ _ng_completion () { ;; s | serve | server ) - opts='--environment --host --insecure-proxy --inspr --live-reload --live-reload-host --live-reload-port --output-path --port --proxy --ssl --ssl-cert --ssl-key --watcher -H -dev -e -lr -lrbu -lrh -lrp -op -out -p -pr -prod -pxy -w' + opts='--environment --host --insecure-proxy --inspr --live-reload --live-reload-base-url --live-reload-host --live-reload-live-css --live-reload-port --output-path --port --proxy --ssl --ssl-cert --ssl-key --target --watcher -H -dev -e -lr -lrbu -lrh -lrp -op -out -p -pr -prod -pxy -t -w' ;; set ) @@ -60,9 +60,13 @@ _ng_completion () { opts='--verbose' ;; - ng | *) + ng ) opts=$ng_opts ;; + + * ) + opts='' + ;; esac setopt shwordsplit From 50f69918a49b67828128cc7089a9435238565a5f Mon Sep 17 00:00:00 2001 From: Carlo Dapor Date: Mon, 15 Aug 2016 15:27:38 +0200 Subject: [PATCH 04/56] Added README.md --- plugins/ng/README.md | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 plugins/ng/README.md diff --git a/plugins/ng/README.md b/plugins/ng/README.md new file mode 100644 index 000000000..86ad64041 --- /dev/null +++ b/plugins/ng/README.md @@ -0,0 +1,37 @@ +## NG Plugin + +This [ng plugin](https://github.com/robbyrussell/oh-my-zsh/tree/master/plugins/ng) + adds completion support for Angular's CLI (named ng). + +Ng is hosted on [ng home](https://github.com/catull/angular-cli) + +It is used to generate Angular 2 app "stubs", build those apps, configure them, +test them, lint them etc. + +Ahem, "stubs" is not what Angular engineers refer to the items ng can generate +for you. + +"Stubs" can be any one of: +- class +- component +- directive +- enum +- module +- pipe +- route +- service + +At the moment, `ng completion` creates a very rough completion for Zsh and +Bash. + +It is missing most of the options and a few arguments. +In future, this plugin may be shortened to simply being + +```zsh +eval `ng completion` +``` + +There is hope this materialises in the 21st century. + +### CONTRIBUTOR + - Carlo Dapor ([catull](https://github.com/catull)) From 796aa460dfdad3b3b8806410bb00cd4179663f47 Mon Sep 17 00:00:00 2001 From: Carlo Dapor Date: Mon, 22 Aug 2016 22:12:40 +0200 Subject: [PATCH 05/56] Feedback from angular-cli is "drop addon, asset-sizes, d, destroy. Also, serve does not support --output-path / -op / -out anymore". This commit corrects it. --- plugins/ng/ng.plugin.zsh | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/plugins/ng/ng.plugin.zsh b/plugins/ng/ng.plugin.zsh index 2488bc230..dc52a6bff 100644 --- a/plugins/ng/ng.plugin.zsh +++ b/plugins/ng/ng.plugin.zsh @@ -1,5 +1,5 @@ -ng_opts='addon asset-sizes b build completion d destroy doc e2e g generate get github-pages:deploy gh-pages:deploy h help i init install lint make-this-awesome new s serve server set t test v version -h --help' +ng_opts='b build completion doc e2e g generate get github-pages:deploy gh-pages:deploy h help i init install lint make-this-awesome new s serve server set t test v version -h --help' _ng_completion () { local words cword opts @@ -8,22 +8,10 @@ _ng_completion () { let cword-=1 case $words[cword] in - addon ) - opts='-b --blueprint -d -dir --directory --dry-run -sb --skip-bower -sg --skip-git -sn --skip-npm -v --verbose' - ;; - - asset-sizes ) - opts='-o --output-path' - ;; - b | build ) opts='--environment --output-path --suppress-sizes --target --watch --watcher -dev -e -prod' ;; - d | destroy ) - opts='--dry-run --verbose --pod --classic --dummy --in-repo --in-repo-addon -d -v -p -c -dum -id -ir' - ;; - g | generate ) opts='class component directive enum module pipe route service --generate -d --dry-run --verbose -v --pod -p --classic -c --dummy -dum -id --in-repo --in-repo-addon -ir' ;; @@ -45,7 +33,7 @@ _ng_completion () { ;; s | serve | server ) - opts='--environment --host --insecure-proxy --inspr --live-reload --live-reload-base-url --live-reload-host --live-reload-live-css --live-reload-port --output-path --port --proxy --ssl --ssl-cert --ssl-key --target --watcher -H -dev -e -lr -lrbu -lrh -lrp -op -out -p -pr -prod -pxy -t -w' + opts='--environment --host --insecure-proxy --inspr --live-reload --live-reload-base-url --live-reload-host --live-reload-live-css --live-reload-port --port --proxy --ssl --ssl-cert --ssl-key --target --watcher -H -dev -e -lr -lrbu -lrh -lrp -p -pr -prod -pxy -t -w' ;; set ) From db755049ca0d76cb68b60255c1e8c1dd9d212887 Mon Sep 17 00:00:00 2001 From: Aaron Decker Date: Fri, 12 Aug 2016 23:49:42 -0400 Subject: [PATCH 06/56] add npm aliases (#5290) --- plugins/npm/npm.plugin.zsh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/plugins/npm/npm.plugin.zsh b/plugins/npm/npm.plugin.zsh index 38e699ea0..422d81ceb 100644 --- a/plugins/npm/npm.plugin.zsh +++ b/plugins/npm/npm.plugin.zsh @@ -20,3 +20,10 @@ alias npmE='PATH="$(npm bin)":"$PATH"' # Check which npm modules are outdated alias npmO="npm outdated" + +# Run npm start +alias npmst="npm start" + +# Run npm test +alias npmt="npm test" + From 31654a75146d1db3af9a9577ffb618927c5723e6 Mon Sep 17 00:00:00 2001 From: Daniel Grove Date: Fri, 12 Aug 2016 20:50:09 -0700 Subject: [PATCH 07/56] Add tmux attach -d alias (#5285) --- plugins/tmux/tmux.plugin.zsh | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/tmux/tmux.plugin.zsh b/plugins/tmux/tmux.plugin.zsh index bc32c8907..fb514a44c 100644 --- a/plugins/tmux/tmux.plugin.zsh +++ b/plugins/tmux/tmux.plugin.zsh @@ -3,6 +3,7 @@ # alias ta='tmux attach -t' +alias tad='tmux attach -d -t' alias ts='tmux new-session -s' alias tl='tmux list-sessions' alias tksv='tmux kill-server' From cfbc4fab04f5ad4a9d033c5a6d490f0a2191947b Mon Sep 17 00:00:00 2001 From: Aleksey Ivanov Date: Sat, 13 Aug 2016 21:47:43 +0300 Subject: [PATCH 08/56] refresh .rake_tasks when lib/tasks changed (#5111) --- plugins/rake-fast/rake-fast.plugin.zsh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/plugins/rake-fast/rake-fast.plugin.zsh b/plugins/rake-fast/rake-fast.plugin.zsh index d305eb1f0..57d699abc 100644 --- a/plugins/rake-fast/rake-fast.plugin.zsh +++ b/plugins/rake-fast/rake-fast.plugin.zsh @@ -8,7 +8,19 @@ _rake_refresh () { } _rake_does_task_list_need_generating () { - [[ ! -f .rake_tasks ]] || [[ Rakefile -nt .rake_tasks ]] + [[ ! -f .rake_tasks ]] || [[ Rakefile -nt .rake_tasks ]] || (_is_rails_app && _tasks_changed) +} + +_is_rails_app () { + [[ -e "bin/rails" ]] || [ -e "script/rails" ] +} + +_tasks_changed () { + local is_changed=1 + for file in lib/tasks/**/*.rake; do + if [[ $file -nt .rake_tasks ]]; then is_changed=0; fi + done + return is_changed } _rake_generate () { From 7888bfa7c19ea4f6a09a38e3716f15d927e30559 Mon Sep 17 00:00:00 2001 From: Patrick Stadler Date: Mon, 15 Aug 2016 02:30:55 +0200 Subject: [PATCH 09/56] add kubectl plugin (#5298) --- plugins/kubectl/kubectl.plugin.zsh | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 plugins/kubectl/kubectl.plugin.zsh diff --git a/plugins/kubectl/kubectl.plugin.zsh b/plugins/kubectl/kubectl.plugin.zsh new file mode 100644 index 000000000..51ae142a2 --- /dev/null +++ b/plugins/kubectl/kubectl.plugin.zsh @@ -0,0 +1,7 @@ +# Autocompletion for kubectl, the command line interface for Kubernetes +# +# Author: https://github.com/pstadler + +if [ $commands[kubectl] ]; then + source <(kubectl completion zsh) +fi From ffa03a15e99d378e64febfc9bbbf8ece4263344d Mon Sep 17 00:00:00 2001 From: Arz Yu Date: Mon, 15 Aug 2016 08:33:48 +0800 Subject: [PATCH 10/56] muse theme: Remove extra spaces for none git/virtualenv prompt (#5278) * muse theme: Remove a extra space for none git prompt * muse theme: Remove a extra space for none virtualenv prompt --- themes/muse.zsh-theme | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/themes/muse.zsh-theme b/themes/muse.zsh-theme index 55a375747..c7cd9ee30 100644 --- a/themes/muse.zsh-theme +++ b/themes/muse.zsh-theme @@ -13,11 +13,11 @@ GIT_DIRTY_COLOR=$FG[133] GIT_CLEAN_COLOR=$FG[118] GIT_PROMPT_INFO=$FG[012] -PROMPT='%{$PROMPT_SUCCESS_COLOR%}%~%{$reset_color%} %{$GIT_PROMPT_INFO%}$(git_prompt_info) $(virtualenv_prompt_info)%{$GIT_DIRTY_COLOR%}$(git_prompt_status) %{$reset_color%}%{$PROMPT_PROMPT%}ᐅ%{$reset_color%} ' +PROMPT='%{$PROMPT_SUCCESS_COLOR%}%~%{$reset_color%}%{$GIT_PROMPT_INFO%}$(git_prompt_info)$(virtualenv_prompt_info)%{$GIT_DIRTY_COLOR%}$(git_prompt_status) %{$reset_color%}%{$PROMPT_PROMPT%}ᐅ%{$reset_color%} ' #RPS1="${return_code}" -ZSH_THEME_GIT_PROMPT_PREFIX="(" +ZSH_THEME_GIT_PROMPT_PREFIX=" (" ZSH_THEME_GIT_PROMPT_SUFFIX="%{$GIT_PROMPT_INFO%})" ZSH_THEME_GIT_PROMPT_DIRTY=" %{$GIT_DIRTY_COLOR%}✘" ZSH_THEME_GIT_PROMPT_CLEAN=" %{$GIT_CLEAN_COLOR%}✔" @@ -28,3 +28,6 @@ ZSH_THEME_GIT_PROMPT_DELETED="%{$FG[160]%}✖%{$reset_color%}" ZSH_THEME_GIT_PROMPT_RENAMED="%{$FG[220]%}➜%{$reset_color%}" ZSH_THEME_GIT_PROMPT_UNMERGED="%{$FG[082]%}═%{$reset_color%}" ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$FG[190]%}✭%{$reset_color%}" + +ZSH_THEME_VIRTUALENV_PREFIX=" [" +ZSH_THEME_VIRTUALENV_SUFFIX="]" From 12c14752194054a9bd49a7ced1c8e6bb8157ba08 Mon Sep 17 00:00:00 2001 From: $ea Date: Mon, 15 Aug 2016 08:43:23 +0800 Subject: [PATCH 11/56] plugins/urltools: add suport for python 3 (#5039) Python 3!!!! --- plugins/urltools/urltools.plugin.zsh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/plugins/urltools/urltools.plugin.zsh b/plugins/urltools/urltools.plugin.zsh index 22327334d..fa337acba 100644 --- a/plugins/urltools/urltools.plugin.zsh +++ b/plugins/urltools/urltools.plugin.zsh @@ -11,9 +11,12 @@ fi if [[ $(whence node) != "" && ( "x$URLTOOLS_METHOD" = "x" || "x$URLTOOLS_METHOD" = "xnode" ) ]]; then alias urlencode='node -e "console.log(encodeURIComponent(process.argv[1]))"' alias urldecode='node -e "console.log(decodeURIComponent(process.argv[1]))"' -elif [[ $(whence python) != "" && ( "x$URLTOOLS_METHOD" = "x" || "x$URLTOOLS_METHOD" = "xpython" ) ]]; then - alias urlencode='python -c "import sys, urllib as ul; print ul.quote_plus(sys.argv[1])"' - alias urldecode='python -c "import sys, urllib as ul; print ul.unquote_plus(sys.argv[1])"' +elif [[ $(whence python3) != "" && ( "x$URLTOOLS_METHOD" = "x" || "x$URLTOOLS_METHOD" = "xpython" ) ]]; then + alias urlencode='python3 -c "import sys, urllib.parse as up; print(up.quote_plus(sys.argv[1]))"' + alias urldecode='python3 -c "import sys, urllib.parse as up; print(up.unquote_plus(sys.argv[1]))"' +elif [[ $(whence python2) != "" && ( "x$URLTOOLS_METHOD" = "x" || "x$URLTOOLS_METHOD" = "xpython" ) ]]; then + alias urlencode='python2 -c "import sys, urllib as ul; print ul.quote_plus(sys.argv[1])"' + alias urldecode='python2 -c "import sys, urllib as ul; print ul.unquote_plus(sys.argv[1])"' elif [[ $(whence xxd) != "" && ( "x$URLTOOLS_METHOD" = "x" || "x$URLTOOLS_METHOD" = "xshell" ) ]]; then function urlencode() {echo $@ | tr -d "\n" | xxd -plain | sed "s/\(..\)/%\1/g"} function urldecode() {printf $(echo -n $@ | sed 's/\\/\\\\/g;s/\(%\)\([0-9a-fA-F][0-9a-fA-F]\)/\\x\2/g')"\n"} From 26a06e11b81aaf6c6d0fe3d42478d74c37e9b2e9 Mon Sep 17 00:00:00 2001 From: naegi Date: Mon, 15 Aug 2016 02:45:00 +0200 Subject: [PATCH 12/56] Plugin : Sudo - Add support of sudoedit (#5035) * Add sudoedit support * change describtion of sudo plugin --- plugins/sudo/sudo.plugin.zsh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/plugins/sudo/sudo.plugin.zsh b/plugins/sudo/sudo.plugin.zsh index 0ba8bed5b..0b843822e 100644 --- a/plugins/sudo/sudo.plugin.zsh +++ b/plugins/sudo/sudo.plugin.zsh @@ -2,7 +2,7 @@ # Description # ----------- # -# sudo will be inserted before the command +# sudo or sudoedit will be inserted before the command # # ------------------------------------------------------------------------------ # Authors @@ -16,6 +16,12 @@ 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" + elif [[ $BUFFER == sudoedit\ * ]]; then + LBUFFER="${LBUFFER#sudoedit }" + LBUFFER="$EDITOR $LBUFFER" else LBUFFER="sudo $LBUFFER" fi From 10a78c1624cdc6848c07de8d8777bea748581e4f Mon Sep 17 00:00:00 2001 From: Ahmad Awais Date: Mon, 15 Aug 2016 05:55:02 +0500 Subject: [PATCH 13/56] =?UTF-8?q?Enhancement:=20Show/Hide=20OSX=20hidden?= =?UTF-8?q?=20files=20=F0=9F=92=AF=20(#5275)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/osx/README.md | 22 ++++++++++++---------- plugins/osx/osx.plugin.zsh | 4 ++++ 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/plugins/osx/README.md b/plugins/osx/README.md index a06184a45..6de2b061e 100644 --- a/plugins/osx/README.md +++ b/plugins/osx/README.md @@ -15,13 +15,15 @@ Original author: [Sorin Ionescu](https://github.com/sorin-ionescu) ## Commands -| Command | Description | -|:--------------|:-----------------------------------------------| -| `tab` | Open the current directory in a new tab | -| `ofd` | Open the current directory in a Finder window | -| `pfd` | Return the path of the frontmost Finder window | -| `pfs` | Return the current Finder selection | -| `cdf` | `cd` to the current Finder directory | -| `pushdf` | `pushd` to the current Finder directory | -| `quick-look` | Quick-Look a specified file | -| `man-preview` | Open a specified man page in Preview app | +| Command | Description | +| :-------------- | :----------------------------------------------- | +| `tab` | Open the current directory in a new tab | +| `ofd` | Open the current directory in a Finder window | +| `pfd` | Return the path of the frontmost Finder window | +| `pfs` | Return the current Finder selection | +| `cdf` | `cd` to the current Finder directory | +| `pushdf` | `pushd` to the current Finder directory | +| `quick-look` | Quick-Look a specified file | +| `man-preview` | Open a specified man page in Preview app | +| `showfiles` | Show hidden files | +| `hidefiles` | Hide the hidden files | diff --git a/plugins/osx/osx.plugin.zsh b/plugins/osx/osx.plugin.zsh index 4dbc75787..f69bd7e5d 100644 --- a/plugins/osx/osx.plugin.zsh +++ b/plugins/osx/osx.plugin.zsh @@ -260,3 +260,7 @@ EOF esac osascript -e "tell application \"iTunes\" to $opt" } + +# Show/hide hidden files in the Finder +alias showfiles="defaults write com.apple.finder AppleShowAllFiles -bool true && killall Finder" +alias hidefiles="defaults write com.apple.finder AppleShowAllFiles -bool false && killall Finder" From 0e7fbad389e6eb68969c5d9e3c92215001d52fd4 Mon Sep 17 00:00:00 2001 From: Dzianis Dashkevich Date: Mon, 15 Aug 2016 03:58:11 +0300 Subject: [PATCH 14/56] Add gcpa and gcpc aliases to git plugin (#5271) --- plugins/git/git.plugin.zsh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh index 3f9ec2c01..cf7e5efda 100644 --- a/plugins/git/git.plugin.zsh +++ b/plugins/git/git.plugin.zsh @@ -75,6 +75,8 @@ alias gco='git checkout' alias gcount='git shortlog -sn' compdef gcount=git alias gcp='git cherry-pick' +alias gcpa='git cherry-pick --abort' +alias gcpc='git cherry-pick --continue' alias gcs='git commit -S' alias gd='git diff' From 35d75839d151abb2ec4ec24d6a055bf6b2b8c983 Mon Sep 17 00:00:00 2001 From: Peter Han Date: Sun, 14 Aug 2016 18:00:19 -0700 Subject: [PATCH 15/56] Create an alias to open up sublime project (#5258) * Adding an alias to open up the sublime project * README update for stp command --- plugins/sublime/README.md | 6 ++++-- plugins/sublime/sublime.plugin.zsh | 29 +++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 2 deletions(-) diff --git a/plugins/sublime/README.md b/plugins/sublime/README.md index e1e666f05..7b02d8428 100644 --- a/plugins/sublime/README.md +++ b/plugins/sublime/README.md @@ -15,5 +15,7 @@ Plugin for Sublime Text, a cross platform text and code editor, available for Li * If `st` is passed a file, open it in Sublime Text * If `stt` command is called, it is equivalent to `st .`, opening the current folder in Sublime Text - - * If `sst` command is called, it is like `sudo st`, opening the file or folder in Sublime Text. Useful for editing system protected files. \ No newline at end of file + + * If `sst` command is called, it is like `sudo st`, opening the file or folder in Sublime Text. Useful for editing system protected files. + + * If `stp` command is called, it find a `.sublime-project` file by traversing up the directory structure. If there is no `.sublime-project` file, but if the current folder is a Git repo, opens up the root directory of the repo. If the current folder is not a Git repo, then opens up the current directory. diff --git a/plugins/sublime/sublime.plugin.zsh b/plugins/sublime/sublime.plugin.zsh index a5d63cde6..75a39eab1 100644 --- a/plugins/sublime/sublime.plugin.zsh +++ b/plugins/sublime/sublime.plugin.zsh @@ -56,3 +56,32 @@ elif [[ "$OSTYPE" = 'cygwin' ]]; then fi alias stt='st .' + +find_project() +{ + local PROJECT_ROOT="${PWD}" + local FINAL_DEST="." + + while [[ $PROJECT_ROOT != "/" && ! -d "$PROJECT_ROOT/.git" ]]; do + PROJECT_ROOT=$(dirname $PROJECT_ROOT) + done + + if [[ $PROJECT_ROOT != "/" ]]; then + local PROJECT_NAME="${PROJECT_ROOT##*/}" + + local SUBL_DIR=$PROJECT_ROOT + while [[ $SUBL_DIR != "/" && ! -f "$SUBL_DIR/$PROJECT_NAME.sublime-project" ]]; do + SUBL_DIR=$(dirname $SUBL_DIR) + done + + if [[ $SUBL_DIR != "/" ]]; then + FINAL_DEST="$SUBL_DIR/$PROJECT_NAME.sublime-project" + else + FINAL_DEST=$PROJECT_ROOT + fi + fi + + st $FINAL_DEST +} + +alias stp=find_project From ae2845b54d80dd0bb4fb141ae45c887574a7b292 Mon Sep 17 00:00:00 2001 From: Thiago Leite Luiz Date: Sun, 14 Aug 2016 22:01:13 -0300 Subject: [PATCH 16/56] Adding alias to rake db:schema:load command. (#5281) --- plugins/rails/rails.plugin.zsh | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/rails/rails.plugin.zsh b/plugins/rails/rails.plugin.zsh index 5dfca49e9..e532639b5 100644 --- a/plugins/rails/rails.plugin.zsh +++ b/plugins/rails/rails.plugin.zsh @@ -57,6 +57,7 @@ alias rdrs='rake db:reset' alias rdtc='rake db:test:clone' alias rdtp='rake db:test:prepare' alias rdmtc='rake db:migrate db:test:clone' +alias rdsl='rake db:schema:load' alias rlc='rake log:clear' alias rn='rake notes' alias rr='rake routes' From 973993954368edb6a30e436da4a6ac2a292c3a05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Wed, 10 Aug 2016 13:35:40 +0200 Subject: [PATCH 17/56] Clean up comments in pj plugin file and reorganise --- plugins/pj/pj.plugin.zsh | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/plugins/pj/pj.plugin.zsh b/plugins/pj/pj.plugin.zsh index 1572e9363..8b1bc883f 100644 --- a/plugins/pj/pj.plugin.zsh +++ b/plugins/pj/pj.plugin.zsh @@ -1,19 +1,6 @@ -#!/bin/zsh +alias pjo="pj open" -# -# Original idea by DefV (Jan De Poorter) -# Source: https://gist.github.com/pjaspers/368394#comment-1016 -# -# Usage: -# - Set `$PROJECT_PATHS` in your ~/.zshrc -# e.g.: PROJECT_PATHS=(~/src ~/work) -# - In ZSH you now can open a project directory with the command: `pj my-project` -# the plugin will locate the `my-project` directory in one of the $PROJECT_PATHS -# Also tab completion is supported. -# - `pjo my-project` will open the directory in $EDITOR -# - -function pj() { +function pj () { cmd="cd" file=$1 @@ -36,8 +23,6 @@ function pj() { echo "No such project $1" } -alias pjo="pj open" - function _pj () { # might be possible to improve this using glob, without the basename trick typeset -a projects @@ -45,5 +30,4 @@ function _pj () { projects=$projects:t _arguments "*:file:($projects)" } - compdef _pj pj From 603cbe3f218bf3a6a8e80a74eeb840f19342c8f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Thu, 11 Aug 2016 01:19:19 +0200 Subject: [PATCH 18/56] Add Readme to pj plugin --- plugins/pj/README.md | 45 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 plugins/pj/README.md diff --git a/plugins/pj/README.md b/plugins/pj/README.md new file mode 100644 index 000000000..27e5638ec --- /dev/null +++ b/plugins/pj/README.md @@ -0,0 +1,45 @@ +# pj + +The `pj` plugin (short for `Project Jump`) allows you to define several +folders where you store your projects, so that you can jump there directly +by just using the name of the project directory. + +Original idea and code by Jan De Poorter ([@DefV](https://github.com/DefV)) +Source: https://gist.github.com/pjaspers/368394#gistcomment-1016 + +## Usage + +1. Enable the `pj` plugin: + + ```zsh + plugins=(... pj) + ``` + +2. Set `$PROJECT_PATHS` in your ~/.zshrc: + + ```zsh + PROJECT_PATHS=(~/src ~/work ~/"dir with spaces") + ``` + +You can now use one of the following commands: + +##### `pj my-project`: + +`cd` to the directory named "my-project" found in one of the `$PROJECT_PATHS` +directories. If there are several directories named the same, the first one +to appear in `$PROJECT_PATHS` has preference. + +For example: +```zsh +PROJECT_PATHS=(~/code ~/work) +$ ls ~/code # ~/code/blog ~/code/react +$ ls ~/work # ~/work/blog ~/work/project +$ pj blog # <-- will cd to ~/code/blog +``` + +##### `pjo my-project` + +Open the project directory with your defined `$EDITOR`. This follows the same +directory rules as the `pj` command above. + +Note: `pjo` is an alias of `pj open`. From fb392e308be14fd248a83f065cd3253b290df19b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Thu, 11 Aug 2016 01:35:45 +0200 Subject: [PATCH 19/56] Fix _pj completion function - `$PROJECT_PATHS/*` wasn't working correctly. You have to iterate over its elements in order to use globbing with it. - The `$projects:t` line wasn't necessary if we used `compadd`. - `compadd` better supports destructuring an array with spaces in some of its elements. --- plugins/pj/pj.plugin.zsh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/plugins/pj/pj.plugin.zsh b/plugins/pj/pj.plugin.zsh index 8b1bc883f..1d89af00b 100644 --- a/plugins/pj/pj.plugin.zsh +++ b/plugins/pj/pj.plugin.zsh @@ -24,10 +24,13 @@ function pj () { } function _pj () { - # might be possible to improve this using glob, without the basename trick + emulate -L zsh + typeset -a projects - projects=($PROJECT_PATHS/*) - projects=$projects:t - _arguments "*:file:($projects)" + for basedir ($PROJECT_PATHS); do + projects+=(${basedir}/*(/N)) + done + + compadd ${projects:t} } compdef _pj pj From b53da8fa597a1db97adfcb0a760820eb27200f2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Thu, 11 Aug 2016 01:33:36 +0200 Subject: [PATCH 20/56] Refactor pj function - Use `emulate -L zsh` to make all variables local. - Use `shwordsplit` to interpret `$cmd` spaces correctly. - Rename `$project` and `$file` variables to the more appropriate `$basedir` and `$project`. --- plugins/pj/pj.plugin.zsh | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/plugins/pj/pj.plugin.zsh b/plugins/pj/pj.plugin.zsh index 1d89af00b..f9d7f8e27 100644 --- a/plugins/pj/pj.plugin.zsh +++ b/plugins/pj/pj.plugin.zsh @@ -1,29 +1,31 @@ alias pjo="pj open" -function pj () { - cmd="cd" - file=$1 +pj () { + emulate -L zsh + setopt shwordsplit - if [[ "open" == "$file" ]] then + cmd="cd" + project=$1 + + if [[ "open" == "$project" ]]; then shift - file=$* - cmd=(${(s: :)EDITOR}) + project=$* + cmd=$EDITOR else - file=$* + project=$* fi - for project in $PROJECT_PATHS; do - if [[ -d $project/$file ]] then - $cmd "$project/$file" - unset project # Unset project var + for basedir ($PROJECT_PATHS); do + if [[ -d "$basedir/$project" ]]; then + $cmd "$basedir/$project" return fi done - echo "No such project $1" + echo "No such project '${project}'." } -function _pj () { +_pj () { emulate -L zsh typeset -a projects From f49596a68a98959dbd6de0ce38a4521a64e5179e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Thu, 11 Aug 2016 01:44:14 +0200 Subject: [PATCH 21/56] Fix pj() function when no project has been specified --- plugins/pj/pj.plugin.zsh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/plugins/pj/pj.plugin.zsh b/plugins/pj/pj.plugin.zsh index f9d7f8e27..bb3d9c058 100644 --- a/plugins/pj/pj.plugin.zsh +++ b/plugins/pj/pj.plugin.zsh @@ -15,6 +15,11 @@ pj () { project=$* fi + if [[ -z "$project" ]]; then + echo "You have to specify a project name." + return + fi + for basedir ($PROJECT_PATHS); do if [[ -d "$basedir/$project" ]]; then $cmd "$basedir/$project" From 08ad38f0e6d05c7dcd2a4de95ce2b656ce682050 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Thu, 11 Aug 2016 01:55:38 +0200 Subject: [PATCH 22/56] Fix shwordsplit bug when a basedir contains spaces The `shwordsplit` option affects all variables and we only need to split the `$EDITOR` variable. Because of that, using `${=spec}` is a much better alternative. More info at http://zsh.sourceforge.net/Doc/Release/Expansion.html#index-SH_005fWORD_005fSPLIT_002c-toggle --- plugins/pj/pj.plugin.zsh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/plugins/pj/pj.plugin.zsh b/plugins/pj/pj.plugin.zsh index bb3d9c058..84d0cfa65 100644 --- a/plugins/pj/pj.plugin.zsh +++ b/plugins/pj/pj.plugin.zsh @@ -2,7 +2,6 @@ alias pjo="pj open" pj () { emulate -L zsh - setopt shwordsplit cmd="cd" project=$1 @@ -10,7 +9,7 @@ pj () { if [[ "open" == "$project" ]]; then shift project=$* - cmd=$EDITOR + cmd=${=EDITOR} else project=$* fi From 43cbb81a60d78ba241d7b2cc890860743d093521 Mon Sep 17 00:00:00 2001 From: Fumseck Date: Wed, 17 Aug 2016 22:26:13 +0200 Subject: [PATCH 23/56] Add alias and README to git-flow plugin (#5129) --- plugins/git-flow/README.md | 36 ++++++++++++++++++++++++++++ plugins/git-flow/git-flow.plugin.zsh | 10 ++++++++ 2 files changed, 46 insertions(+) create mode 100644 plugins/git-flow/README.md diff --git a/plugins/git-flow/README.md b/plugins/git-flow/README.md new file mode 100644 index 000000000..d4cde34aa --- /dev/null +++ b/plugins/git-flow/README.md @@ -0,0 +1,36 @@ +# Git flow plugin installation + +```bash +git clone https://github.com/robbyrussell/oh-my-zsh.git + +cp oh-my-zsh/plugins/git-flow/git-flow.plugin.zsh ~/.git-flow-completion.zsh + +vim ~/.zshrc + +# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*) +# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/ +# Example format: plugins=(rails git textmate ruby lighthouse) +# Add wisely, as too many plugins slow down shell startup. + +plugins=(git git-flow) + +source ~/.git-flow-completion.zsh +``` +## Your new git-flow alias + +```bash +alias gfl='git flow' +alias gfli='git flow init' +alias gcd='git checkout develop' +alias gch='git checkout hotfix' +alias gcr='git checkout release' +alias gflf='git flow feature' +alias gflh='git flow hotfix' +alias gflr='git flow release' +alias gflfs='git flow feature start' +alias gflhs='git flow hotfix start' +alias gflrs='git flow release start' +alias gflff='git flow feature finish' +alias gflhf='git flow hotfix finish' +alias gflrf='git flow release finish' +``` diff --git a/plugins/git-flow/git-flow.plugin.zsh b/plugins/git-flow/git-flow.plugin.zsh index a8386cb19..bda050725 100644 --- a/plugins/git-flow/git-flow.plugin.zsh +++ b/plugins/git-flow/git-flow.plugin.zsh @@ -22,9 +22,19 @@ #Alias alias gfl='git flow' +alias gfli='git flow init' alias gcd='git checkout develop' alias gch='git checkout hotfix' alias gcr='git checkout release' +alias gflf='git flow feature' +alias gflh='git flow hotfix' +alias gflr='git flow release' +alias gflfs='git flow feature start' +alias gflhs='git flow hotfix start' +alias gflrs='git flow release start' +alias gflff='git flow feature finish' +alias gflhf='git flow hotfix finish' +alias gflrf='git flow release finish' _git-flow () { From 97fd86dfdf05530bf48a3e446d390db6c7577536 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Wed, 17 Aug 2016 22:39:41 +0200 Subject: [PATCH 24/56] Fix git-flow README - Fix "installation" information - Add links to github project - Transform list of aliases into table with descriptions --- plugins/git-flow/README.md | 59 +++++++++++++++++--------------------- 1 file changed, 27 insertions(+), 32 deletions(-) diff --git a/plugins/git-flow/README.md b/plugins/git-flow/README.md index d4cde34aa..f37f418db 100644 --- a/plugins/git-flow/README.md +++ b/plugins/git-flow/README.md @@ -1,36 +1,31 @@ -# Git flow plugin installation +# Git-Flow plugin -```bash -git clone https://github.com/robbyrussell/oh-my-zsh.git +This plugin adds completion and aliases for the `git-flow` command. More information +at https://github.com/nvie/gitflow. -cp oh-my-zsh/plugins/git-flow/git-flow.plugin.zsh ~/.git-flow-completion.zsh - -vim ~/.zshrc - -# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*) -# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/ -# Example format: plugins=(rails git textmate ruby lighthouse) -# Add wisely, as too many plugins slow down shell startup. - -plugins=(git git-flow) - -source ~/.git-flow-completion.zsh +Enable git-flow plugin in your zshrc file: +``` +plugins=(... git-flow) ``` -## Your new git-flow alias -```bash -alias gfl='git flow' -alias gfli='git flow init' -alias gcd='git checkout develop' -alias gch='git checkout hotfix' -alias gcr='git checkout release' -alias gflf='git flow feature' -alias gflh='git flow hotfix' -alias gflr='git flow release' -alias gflfs='git flow feature start' -alias gflhs='git flow hotfix start' -alias gflrs='git flow release start' -alias gflff='git flow feature finish' -alias gflhf='git flow hotfix finish' -alias gflrf='git flow release finish' -``` +## Aliases + +More information about `git-flow` commands: +https://github.com/nvie/gitflow/wiki/Command-Line-Arguments + +| Alias | Command | Description | +|---------|---------------------------|----------------------------------------| +| `gfl` | `git flow` | Git-Flow command | +| `gfli` | `git flow init` | Initialize git-flow repository | +| `gcd` | `git checkout develop` | Check out develop branch | +| `gch` | `git checkout hotfix` | Check out hotfix branch | +| `gcr` | `git checkout release` | Check out release branch | +| `gflf` | `git flow feature` | List existing feature branches | +| `gflh` | `git flow hotfix` | List existing hotfix branches | +| `gflr` | `git flow release` | List existing release branches | +| `gflfs` | `git flow feature start` | Start a new feature: `gflfs ` | +| `gflhs` | `git flow hotfix start` | Start a new hotfix: `gflhs ` | +| `gflrs` | `git flow release start` | Start a new release: `gflrs ` | +| `gflff` | `git flow feature finish` | Finish feature: `gflff ` | +| `gflhf` | `git flow hotfix finish` | Finish hotfix: `gflhf ` | +| `gflrf` | `git flow release finish` | Finish release: `gflrf ` | From 5a839456865886530f390cdd89431fee7e3e71d3 Mon Sep 17 00:00:00 2001 From: Emmanuel Isaac Date: Thu, 18 Aug 2016 08:22:21 +0100 Subject: [PATCH 25/56] Add git alias to clear entire stash (#5306) Using the "gstc" alias runs "git stash clear" that clears every stash index --- plugins/git/git.plugin.zsh | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh index cf7e5efda..5d7fa3294 100644 --- a/plugins/git/git.plugin.zsh +++ b/plugins/git/git.plugin.zsh @@ -216,6 +216,7 @@ alias gss='git status -s' alias gst='git status' alias gsta='git stash save' alias gstaa='git stash apply' +alias gstc='git stash clear' alias gstd='git stash drop' alias gstl='git stash list' alias gstp='git stash pop' From 9b088a3d62428e137e6c22f5ba81cf7696c594a4 Mon Sep 17 00:00:00 2001 From: Piotr Gaczkowski Date: Sun, 21 Aug 2016 00:02:58 +0200 Subject: [PATCH 26/56] Clobber ssh environment regardless of setopt (#5322) --- plugins/ssh-agent/ssh-agent.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/ssh-agent/ssh-agent.plugin.zsh b/plugins/ssh-agent/ssh-agent.plugin.zsh index 610ad34dc..b77b9ee78 100644 --- a/plugins/ssh-agent/ssh-agent.plugin.zsh +++ b/plugins/ssh-agent/ssh-agent.plugin.zsh @@ -37,7 +37,7 @@ function _plugin__start_agent() zstyle -s :omz:plugins:ssh-agent lifetime lifetime # start ssh-agent and setup environment - /usr/bin/env ssh-agent ${lifetime:+-t} ${lifetime} | sed 's/^echo/#echo/' > ${_plugin__ssh_env} + /usr/bin/env ssh-agent ${lifetime:+-t} ${lifetime} | sed 's/^echo/#echo/' >! ${_plugin__ssh_env} chmod 600 ${_plugin__ssh_env} . ${_plugin__ssh_env} > /dev/null From bb61b902978695f05e47e7cfb35ec5039be8d416 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Sun, 21 Aug 2016 00:09:59 +0200 Subject: [PATCH 27/56] Revert "Fix pj() function when no project has been specified" This reverts commit 7d298a3059f4df72866b4ef649675b594120f453. --- plugins/pj/pj.plugin.zsh | 5 ----- 1 file changed, 5 deletions(-) diff --git a/plugins/pj/pj.plugin.zsh b/plugins/pj/pj.plugin.zsh index 84d0cfa65..e36d49204 100644 --- a/plugins/pj/pj.plugin.zsh +++ b/plugins/pj/pj.plugin.zsh @@ -14,11 +14,6 @@ pj () { project=$* fi - if [[ -z "$project" ]]; then - echo "You have to specify a project name." - return - fi - for basedir ($PROJECT_PATHS); do if [[ -d "$basedir/$project" ]]; then $cmd "$basedir/$project" From fc3a6ebde0b15a699f1170283a99b143f4c38816 Mon Sep 17 00:00:00 2001 From: khenarghot Date: Sun, 21 Aug 2016 20:40:34 +0400 Subject: [PATCH 28/56] Fix git emptiness check in dogenpunk theme (#5329) The parsing output for full git log output too slow so it replaced with last commit show request, wich cause error if repository is empty --- themes/dogenpunk.zsh-theme | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/dogenpunk.zsh-theme b/themes/dogenpunk.zsh-theme index d6719281d..6a9921288 100644 --- a/themes/dogenpunk.zsh-theme +++ b/themes/dogenpunk.zsh-theme @@ -37,7 +37,7 @@ ZSH_THEME_GIT_TIME_SINCE_COMMIT_NEUTRAL="%{$fg[cyan]%}" function git_time_since_commit() { if git rev-parse --git-dir > /dev/null 2>&1; then # Only proceed if there is actually a commit. - if [[ $(git log 2>&1 > /dev/null | grep -c "^fatal: bad default revision") == 0 ]]; then + if git log -n 1 > /dev/null 2>&1; then # Get the last commit. last_commit=`git log --pretty=format:'%at' -1 2> /dev/null` now=`date +%s` From ded0f4717d8906f4116c4897d8aa772af2677118 Mon Sep 17 00:00:00 2001 From: Simon Date: Sun, 21 Aug 2016 19:46:37 +0200 Subject: [PATCH 29/56] Add alias for checking out develop branch (#5307) --- plugins/git/git.plugin.zsh | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh index 5d7fa3294..5f310141b 100644 --- a/plugins/git/git.plugin.zsh +++ b/plugins/git/git.plugin.zsh @@ -70,6 +70,7 @@ alias gcl='git clone --recursive' alias gclean='git clean -fd' alias gpristine='git reset --hard && git clean -dfx' alias gcm='git checkout master' +alias gcd='git checkout develop' alias gcmsg='git commit -m' alias gco='git checkout' alias gcount='git shortlog -sn' From a23da4ae1e916beb2b15b9655a12914f026d6353 Mon Sep 17 00:00:00 2001 From: Shubham Chaudhary Date: Sun, 21 Aug 2016 23:36:47 +0530 Subject: [PATCH 30/56] Add more go aliases (#5259) * Also gfa conflicts with git shortcut --- plugins/golang/golang.plugin.zsh | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/plugins/golang/golang.plugin.zsh b/plugins/golang/golang.plugin.zsh index 1ce3cea58..d9d450690 100644 --- a/plugins/golang/golang.plugin.zsh +++ b/plugins/golang/golang.plugin.zsh @@ -179,5 +179,15 @@ __go_tool_complete() { compdef __go_tool_complete go -# aliases -alias gfa='go fmt . ./...' +# aliases: go<~> +alias gob='go build' +alias goc='go clean' +alias god='go doc' +alias gof='go fmt' +alias gofa='go fmt . ./...' +alias gog='go get' +alias goi='go install' +alias gol='go list' +alias gor='go run' +alias got='go test' +alias gov='go vet' From 5145025d3ebd616e63276a27ffb1da316757cf85 Mon Sep 17 00:00:00 2001 From: Philipp Wahala Date: Mon, 29 Feb 2016 10:16:26 +0100 Subject: [PATCH 31/56] Create and cache npm completion on first run MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marc Cornellà --- plugins/npm/npm.plugin.zsh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/plugins/npm/npm.plugin.zsh b/plugins/npm/npm.plugin.zsh index 422d81ceb..ec595e74d 100644 --- a/plugins/npm/npm.plugin.zsh +++ b/plugins/npm/npm.plugin.zsh @@ -1,4 +1,10 @@ -eval "$(npm completion 2>/dev/null)" +__NPM_COMPLETION_FILE="${ZSH_CACHE_DIR}/npm_completion" + +if [[ ! -f $__NPM_COMPLETION_FILE ]]; then + npm completion >! $__NPM_COMPLETION_FILE || rm -f $__NPM_COMPLETION_FILE +fi + +source $__NPM_COMPLETION_FILE # Install dependencies globally alias npmg="npm i -g " From 03c3b4301eab35b8498cef69cb815fc9fdded3d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Fri, 17 Jun 2016 10:44:52 +0200 Subject: [PATCH 32/56] dircycle: keep switch until a directory is found This fixes the use case where a directory in the dir stack doesn't exist anymore, so the keystroke doesn't appear to do anything. It will keep trying to switch to the n-est directory in the stack until it founds an available directory or the dirstack has no more directories to switch to. --- plugins/dircycle/dircycle.plugin.zsh | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/plugins/dircycle/dircycle.plugin.zsh b/plugins/dircycle/dircycle.plugin.zsh index 8a406b54d..2f32277cf 100644 --- a/plugins/dircycle/dircycle.plugin.zsh +++ b/plugins/dircycle/dircycle.plugin.zsh @@ -8,11 +8,21 @@ # pushd +N: start counting from left of `dirs' output # pushd -N: start counting from right of `dirs' output +switch-to-dir () { + while ! builtin pushd -q $1 &>/dev/null; do + # We found a missing directory: pop it out of the dir stack + builtin popd -q $1 + + # Stop trying if there are no more directories in the dir stack + [[ ${#dirstack} -eq 0 ]] && break + done +} + insert-cycledleft () { emulate -L zsh setopt nopushdminus - builtin pushd -q +1 &>/dev/null || true + switch-to-dir +1 zle reset-prompt } zle -N insert-cycledleft @@ -21,7 +31,7 @@ insert-cycledright () { emulate -L zsh setopt nopushdminus - builtin pushd -q -0 &>/dev/null || true + switch-to-dir -0 zle reset-prompt } zle -N insert-cycledright From 62da70d0ab156b974ad3b8255934fe7292363703 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Madsen?= Date: Thu, 18 Jun 2015 11:24:17 +0200 Subject: [PATCH 33/56] archlinux: Update yasu alias MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marc Cornellà --- plugins/archlinux/README.md | 2 +- plugins/archlinux/archlinux.plugin.zsh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/archlinux/README.md b/plugins/archlinux/README.md index ad42d4cd2..67595f9e9 100644 --- a/plugins/archlinux/README.md +++ b/plugins/archlinux/README.md @@ -37,7 +37,7 @@ | yarem | yaourt -Rns | Remove the specified package(s), its configuration(s) and unneeded dependencies | | yarep | yaourt -Si | Display information about a given package in the repositories | | yareps | yaourt -Ss | Search for package(s) in the repositories | -| yasu | yaourt --sucre | Same as yaupg, but without confirmation | +| yasu | yaourt -Syua --no-confirm | Same as yaupg, but without confirmation | | yaupd | yaourt -Sy && sudo abs && sudo aur | Update and refresh the local package, ABS and AUR databases against repositories | | yaupd | yaourt -Sy && sudo abs | Update and refresh the local package and ABS databases against repositories | | yaupd | yaourt -Sy && sudo aur | Update and refresh the local package and AUR databases against repositories | diff --git a/plugins/archlinux/archlinux.plugin.zsh b/plugins/archlinux/archlinux.plugin.zsh index 99de5b936..f68443285 100644 --- a/plugins/archlinux/archlinux.plugin.zsh +++ b/plugins/archlinux/archlinux.plugin.zsh @@ -9,7 +9,7 @@ if (( $+commands[yaourt] )); then alias yaconf='yaourt -C' # Fix all configuration files with vimdiff # Pacman - https://wiki.archlinux.org/index.php/Pacman_Tips alias yaupg='yaourt -Syua' # Synchronize with repositories before upgrading packages (AUR packages too) that are out of date on the local system. - alias yasu='yaourt --sucre' # Same as yaupg, but without confirmation + alias yasu='yaourt --Syua --no-confirm' # Same as yaupg, but without confirmation alias yain='yaourt -S' # Install specific package(s) from the repositories alias yains='yaourt -U' # Install specific package not from the repositories but from a file alias yare='yaourt -R' # Remove the specified package(s), retaining its configuration(s) and required dependencies From 4c013d3004e9fbc060bcbdf51968f3eaadd7e591 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Tue, 23 Aug 2016 09:31:29 +0200 Subject: [PATCH 34/56] npm: only load completion if npm exists --- plugins/npm/npm.plugin.zsh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/plugins/npm/npm.plugin.zsh b/plugins/npm/npm.plugin.zsh index ec595e74d..480e92a91 100644 --- a/plugins/npm/npm.plugin.zsh +++ b/plugins/npm/npm.plugin.zsh @@ -1,8 +1,10 @@ -__NPM_COMPLETION_FILE="${ZSH_CACHE_DIR}/npm_completion" +(( $+commands[npm] )) && { + __NPM_COMPLETION_FILE="${ZSH_CACHE_DIR}/npm_completion" -if [[ ! -f $__NPM_COMPLETION_FILE ]]; then - npm completion >! $__NPM_COMPLETION_FILE || rm -f $__NPM_COMPLETION_FILE -fi + if [[ ! -f $__NPM_COMPLETION_FILE ]]; then + npm completion >! $__NPM_COMPLETION_FILE || rm -f $__NPM_COMPLETION_FILE + fi +} source $__NPM_COMPLETION_FILE From 3404f9290f0a5f9b1a5125b9865af247fd46923e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Thu, 16 Jun 2016 21:14:51 +0200 Subject: [PATCH 35/56] Reorder zshrc template --- templates/zshrc.zsh-template | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/templates/zshrc.zsh-template b/templates/zshrc.zsh-template index 632490132..00d25bc93 100644 --- a/templates/zshrc.zsh-template +++ b/templates/zshrc.zsh-template @@ -1,10 +1,12 @@ +# If you come from bash you might have to change your $PATH. +# export PATH=$HOME/bin:/usr/local/bin:$PATH + # Path to your oh-my-zsh installation. export ZSH=$HOME/.oh-my-zsh -# Set name of the theme to load. -# Look in ~/.oh-my-zsh/themes/ -# Optionally, if you set this to "random", it'll load a random theme each -# time that oh-my-zsh is loaded. +# Set name of the theme to load. Optionally, if you set this to "random" +# it'll load a random theme each time that oh-my-zsh is loaded. +# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes ZSH_THEME="robbyrussell" # Uncomment the following line to use case-sensitive completion. @@ -51,13 +53,12 @@ ZSH_THEME="robbyrussell" # Add wisely, as too many plugins slow down shell startup. plugins=(git) +source $ZSH/oh-my-zsh.sh + # User configuration -# export PATH="/usr/bin:/bin:/usr/sbin:/sbin:$PATH" # export MANPATH="/usr/local/man:$MANPATH" -source $ZSH/oh-my-zsh.sh - # You may need to manually set your language environment # export LANG=en_US.UTF-8 From 93ec06cbeddd6b53dbe6bc0ab03ce81801ffc423 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Wed, 24 Aug 2016 00:13:24 +0200 Subject: [PATCH 36/56] Properly fix npm completion source Problem introduced in 136a834. --- plugins/npm/npm.plugin.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/npm/npm.plugin.zsh b/plugins/npm/npm.plugin.zsh index 480e92a91..30b91ec9c 100644 --- a/plugins/npm/npm.plugin.zsh +++ b/plugins/npm/npm.plugin.zsh @@ -4,9 +4,9 @@ if [[ ! -f $__NPM_COMPLETION_FILE ]]; then npm completion >! $__NPM_COMPLETION_FILE || rm -f $__NPM_COMPLETION_FILE fi -} -source $__NPM_COMPLETION_FILE + source $__NPM_COMPLETION_FILE +} # Install dependencies globally alias npmg="npm i -g " From 660a758f61105c4b85f88c089b0948a6d1dbe0f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Wed, 24 Aug 2016 08:08:55 +0200 Subject: [PATCH 37/56] archlinux: remove comments, format functions better --- plugins/archlinux/archlinux.plugin.zsh | 124 ++++++++++++------------- 1 file changed, 60 insertions(+), 64 deletions(-) diff --git a/plugins/archlinux/archlinux.plugin.zsh b/plugins/archlinux/archlinux.plugin.zsh index f68443285..ef862f14c 100644 --- a/plugins/archlinux/archlinux.plugin.zsh +++ b/plugins/archlinux/archlinux.plugin.zsh @@ -1,74 +1,72 @@ -# Archlinux zsh aliases and functions -# Usage is also described at https://github.com/robbyrussell/oh-my-zsh/wiki/Plugins - -# Look for yaourt, and add some useful functions if we have it. -if (( $+commands[yaourt] )); then +if ! (( $+commands[yaourt] )); then + upgrade() { + sudo pacman -Syu + } +else upgrade () { yaourt -Syu } - alias yaconf='yaourt -C' # Fix all configuration files with vimdiff - # Pacman - https://wiki.archlinux.org/index.php/Pacman_Tips - alias yaupg='yaourt -Syua' # Synchronize with repositories before upgrading packages (AUR packages too) that are out of date on the local system. - alias yasu='yaourt --Syua --no-confirm' # Same as yaupg, but without confirmation - alias yain='yaourt -S' # Install specific package(s) from the repositories - alias yains='yaourt -U' # Install specific package not from the repositories but from a file - alias yare='yaourt -R' # Remove the specified package(s), retaining its configuration(s) and required dependencies - alias yarem='yaourt -Rns' # Remove the specified package(s), its configuration(s) and unneeded dependencies - alias yarep='yaourt -Si' # Display information about a given package in the repositories - alias yareps='yaourt -Ss' # Search for package(s) in the repositories - alias yaloc='yaourt -Qi' # Display information about a given package in the local database - alias yalocs='yaourt -Qs' # Search for package(s) in the local database - alias yalst='yaourt -Qe' # List installed packages, even those installed from AUR (they're tagged as "local") - alias yaorph='yaourt -Qtd' # Remove orphans using yaourt - # Additional yaourt alias examples + + alias yaconf='yaourt -C' + alias yaupg='yaourt -Syua' + alias yasu='yaourt --Syua --no-confirm' + alias yain='yaourt -S' + alias yains='yaourt -U' + alias yare='yaourt -R' + alias yarem='yaourt -Rns' + alias yarep='yaourt -Si' + alias yareps='yaourt -Ss' + alias yaloc='yaourt -Qi' + alias yalocs='yaourt -Qs' + alias yalst='yaourt -Qe' + alias yaorph='yaourt -Qtd' + alias yainsd='yaourt -S --asdeps' + alias yamir='yaourt -Syy' + + if (( $+commands[abs] && $+commands[aur] )); then - alias yaupd='yaourt -Sy && sudo abs && sudo aur' # Update and refresh the local package, ABS and AUR databases against repositories + alias yaupd='yaourt -Sy && sudo abs && sudo aur' elif (( $+commands[abs] )); then - alias yaupd='yaourt -Sy && sudo abs' # Update and refresh the local package and ABS databases against repositories + alias yaupd='yaourt -Sy && sudo abs' elif (( $+commands[aur] )); then - alias yaupd='yaourt -Sy && sudo aur' # Update and refresh the local package and AUR databases against repositories + alias yaupd='yaourt -Sy && sudo aur' else - alias yaupd='yaourt -Sy' # Update and refresh the local package database against repositories + alias yaupd='yaourt -Sy' fi - alias yainsd='yaourt -S --asdeps' # Install given package(s) as dependencies of another package - alias yamir='yaourt -Syy' # Force refresh of all package lists after updating /etc/pacman.d/mirrorlist -else - upgrade() { - sudo pacman -Syu - } fi # Pacman - https://wiki.archlinux.org/index.php/Pacman_Tips -alias pacupg='sudo pacman -Syu' # Synchronize with repositories before upgrading packages that are out of date on the local system. -alias pacin='sudo pacman -S' # Install specific package(s) from the repositories -alias pacins='sudo pacman -U' # Install specific package not from the repositories but from a file -alias pacre='sudo pacman -R' # Remove the specified package(s), retaining its configuration(s) and required dependencies -alias pacrem='sudo pacman -Rns' # Remove the specified package(s), its configuration(s) and unneeded dependencies -alias pacrep='pacman -Si' # Display information about a given package in the repositories -alias pacreps='pacman -Ss' # Search for package(s) in the repositories -alias pacloc='pacman -Qi' # Display information about a given package in the local database -alias paclocs='pacman -Qs' # Search for package(s) in the local database -# Additional pacman alias examples -if (( $+commands[abs] && $+commands[aur] )); then - alias pacupd='sudo pacman -Sy && sudo abs && sudo aur' # Update and refresh the local package, ABS and AUR databases against repositories -elif (( $+commands[abs] )); then - alias pacupd='sudo pacman -Sy && sudo abs' # Update and refresh the local package and ABS databases against repositories -elif (( $+commands[aur] )); then - alias pacupd='sudo pacman -Sy && sudo aur' # Update and refresh the local package and AUR databases against repositories -else - alias pacupd='sudo pacman -Sy' # Update and refresh the local package database against repositories -fi -alias pacinsd='sudo pacman -S --asdeps' # Install given package(s) as dependencies of another package -alias pacmir='sudo pacman -Syy' # Force refresh of all package lists after updating /etc/pacman.d/mirrorlist - -# https://bbs.archlinux.org/viewtopic.php?id=93683 -paclist() { - LC_ALL=C pacman -Qei $(pacman -Qu|cut -d" " -f 1)|awk ' BEGIN {FS=":"}/^Name/{printf("\033[1;36m%s\033[1;37m", $2)}/^Description/{print $2}' -} - +alias pacupg='sudo pacman -Syu' +alias pacin='sudo pacman -S' +alias pacins='sudo pacman -U' +alias pacre='sudo pacman -R' +alias pacrem='sudo pacman -Rns' +alias pacrep='pacman -Si' +alias pacreps='pacman -Ss' +alias pacloc='pacman -Qi' +alias paclocs='pacman -Qs' +alias pacinsd='sudo pacman -S --asdeps' +alias pacmir='sudo pacman -Syy' alias paclsorphans='sudo pacman -Qdt' alias pacrmorphans='sudo pacman -Rs $(pacman -Qtdq)' + +if (( $+commands[abs] && $+commands[aur] )); then + alias pacupd='sudo pacman -Sy && sudo abs && sudo aur' +elif (( $+commands[abs] )); then + alias pacupd='sudo pacman -Sy && sudo abs' +elif (( $+commands[aur] )); then + alias pacupd='sudo pacman -Sy && sudo aur' +else + alias pacupd='sudo pacman -Sy' +fi + +paclist() { + # Source: https://bbs.archlinux.org/viewtopic.php?id=93683 + LC_ALL=C pacman -Qei $(pacman -Qu | cut -d " " -f 1) | \ + awk 'BEGIN {FS=":"} /^Name/{printf("\033[1;36m%s\033[1;37m", $2)} /^Description/{print $2}' +} + pacdisowned() { tmp=${TMPDIR-/tmp}/pacman-disowned-$UID-$$ db=$tmp/db @@ -79,18 +77,16 @@ pacdisowned() { pacman -Qlq | sort -u > "$db" - find /bin /etc /lib /sbin /usr \ - ! -name lost+found \ - \( -type d -printf '%p/\n' -o -print \) | sort > "$fs" + find /bin /etc /lib /sbin /usr ! -name lost+found \ + \( -type d -printf '%p/\n' -o -print \) | sort > "$fs" comm -23 "$fs" "$db" } pacmanallkeys() { - # Get all keys for developers and trusted users - curl https://www.archlinux.org/{developers,trustedusers}/ | - awk -F\" '(/pgp.mit.edu/) {sub(/.*search=0x/,"");print $1}' | - xargs sudo pacman-key --recv-keys + curl https://www.archlinux.org/{developers,trustedusers}/ | \ + awk -F\" '(/pgp.mit.edu/) { sub(/.*search=0x/,""); print $1}' | \ + xargs sudo pacman-key --recv-keys } pacmansignkeys() { From 2b1a49e30bc77a388a5de18e79a03d30cdb3f253 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Wed, 24 Aug 2016 08:48:03 +0200 Subject: [PATCH 38/56] archlinux: reword and simplify README --- plugins/archlinux/README.md | 123 +++++++++++++++++++----------------- 1 file changed, 64 insertions(+), 59 deletions(-) diff --git a/plugins/archlinux/README.md b/plugins/archlinux/README.md index 67595f9e9..785538a56 100644 --- a/plugins/archlinux/README.md +++ b/plugins/archlinux/README.md @@ -1,64 +1,69 @@ -## ARCHLINUX PLUGIN +# Archlinux plugin +## Features + +#### YAOURT + +| Alias | Command | Description | +|---------|------------------------------------|---------------------------------------------------------------------| +| yaconf | yaourt -C | Fix all configuration files with vimdiff | +| yain | yaourt -S | Install packages from the repositories | +| yains | yaourt -U | Install a package from a local file | +| yainsd | yaourt -S --asdeps | Install packages as dependencies of another package | +| yaloc | yaourt -Qi | Display information about a package in the local database | +| yalocs | yaourt -Qs | Search for packages in the local database | +| yalst | yaourt -Qe | List installed packages including from AUR (tagged as "local") | +| yamir | yaourt -Syy | Force refresh of all package lists after updating mirrorlist | +| yaorph | yaourt -Qtd | Remove orphans using yaourt | +| yare | yaourt -R | Remove packages, keeping its settings and dependencies | +| yarem | yaourt -Rns | Remove packages, including its settings and unneeded dependencies | +| yarep | yaourt -Si | Display information about a package in the repositories | +| yareps | yaourt -Ss | Search for packages in the repositories | +| yaupd | yaourt -Sy && sudo abs && sudo aur | Update and refresh local package, ABS and AUR databases | +| yaupd | yaourt -Sy && sudo abs | Update and refresh the local package and ABS databases | +| yaupd | yaourt -Sy && sudo aur | Update and refresh the local package and AUR databases | +| yaupd | yaourt -Sy | Update and refresh the local package database | +| yaupg | yaourt -Syua | Sync with repositories before upgrading all packages (from AUR too) | +| yasu | yaourt -Syua --no-confirm | Same as `yaupg`, but without confirmation | +| upgrade | yaourt -Syu | Sync with repositories before upgrading packages | + +#### PACMAN + +| Alias | Command | Description | +|--------------|-----------------------------------------|--------------------------------------------------------------| +| pacin | sudo pacman -S | Install packages from the repositories | +| pacins | sudo pacman -U | Install a package from a local file | +| pacinsd | sudo pacman -S --asdeps | Install packages as dependencies of another package | +| pacloc | pacman -Qi | Display information about a package in the local database | +| paclocs | pacman -Qs | Search for packages in the local database | +| paclsorphans | sudo pacman -Qdt | List all orphaned packages | +| pacmir | sudo pacman -Syy | Force refresh of all package lists after updating mirrorlist | +| pacre | sudo pacman -R | Remove packages, keeping its settings and dependencies | +| pacrem | sudo pacman -Rns | Remove packages, including its settings and dependencies | +| pacrep | pacman -Si | Display information about a package in the repositories | +| pacreps | pacman -Ss | Search for packages in the repositories | +| pacrmorphans | sudo pacman -Rs $(pacman -Qtdq) | Delete all orphaned packages | +| pacupd | sudo pacman -Sy && sudo abs && sudo aur | Update and refresh the local package, ABS and AUR databases | +| pacupd | sudo pacman -Sy && sudo abs | Update and refresh the local package and ABS databases | +| pacupd | sudo pacman -Sy && sudo aur | Update and refresh the local package and AUR databases | +| pacupd | sudo pacman -Sy | Update and refresh the local package database | +| pacupg | sudo pacman -Syu | Sync with repositories before upgrading packages | +| upgrade | sudo pacman -Syu | Sync with repositories before upgrading packages | + +| Function | Description | +|----------------|------------------------------------------------------| +| pacdisowned | List all disowned files in your system | +| paclist | List all installed packages with a short description | +| pacmanallkeys | Get all keys for developers and trusted users | +| pacmansignkeys | Locally trust all keys passed as parameters | --- -### FEATURES +## Contributors -| Alias | Function | Description | -|:------------:|-----------------------------------------|:--------------------------------------------------------------------------------------------------------------------| -| pacin | sudo pacman -S | Install specific package(s) from the repositories | -| pacins | sudo pacman -U | Install specific package not from the repositories but from a file | -| pacinsd | sudo pacman -S --asdeps | Install given package(s) as dependencies of another package | -| pacloc | pacman -Qi | Display information about a given package in the local database | -| paclocs | pacman -Qs | Search for package(s) in the local database | -| paclsorphans | sudo pacman -Qdt' | List all orphaned packages | -| pacmir | sudo pacman -Syy | Force refresh of all package lists after updating /etc/pacman.d/mirrorlist | -| pacre | sudo pacman -R | Remove the specified package(s), retaining its configuration(s) and required dependencies | -| pacrem | sudo pacman -Rns | Remove the specified package(s), its configuration(s) and unneeded dependencies | -| pacrep | pacman -Si | Display information about a given package in the repositories | -| pacreps | pacman -Ss | Search for package(s) in the repositories | -| pacrmorphans | sudo pacman -Rs $(pacman -Qtdq)' | Delete all orphaned packages | -| pacupd | sudo pacman -Sy && sudo abs && sudo aur | Update and refresh the local package, ABS and AUR databases against repositories | -| pacupd | sudo pacman -Sy && sudo abs | Update and refresh the local package and ABS databases against repositories | -| pacupd | sudo pacman -Sy && sudo aur | Update and refresh the local package and AUR databases against repositories | -| pacupd | sudo pacman -Sy | Update and refresh the local package database against repositories | -| pacupg | sudo pacman -Syu | Synchronize with repositories before upgrading packages that are out of date on the local system. | -| yaconf | yaourt -C | Fix all configuration files with vimdiff | -| yain | yaourt -S | Install specific package(s) from the repositories | -| yains | yaourt -U | Install specific package not from the repositories but from a file | -| yainsd | yaourt -S --asdeps | Install given package(s) as dependencies of another package | -| yaloc | yaourt -Qi | Display information about a given package in the local database | -| yalocs | yaourt -Qs | Search for package(s) in the local database | -| yalst | yaourt -Qe | List installed packages, even those installed from AUR (they're tagged as "local") | -| yamir | yaourt -Syy | Force refresh of all package lists after updating /etc/pacman.d/mirrorlist | -| yaorph | yaourt -Qtd | Remove orphans using yaourt | -| yare | yaourt -R | Remove the specified package(s), retaining its configuration(s) and required dependencies | -| yarem | yaourt -Rns | Remove the specified package(s), its configuration(s) and unneeded dependencies | -| yarep | yaourt -Si | Display information about a given package in the repositories | -| yareps | yaourt -Ss | Search for package(s) in the repositories | -| yasu | yaourt -Syua --no-confirm | Same as yaupg, but without confirmation | -| yaupd | yaourt -Sy && sudo abs && sudo aur | Update and refresh the local package, ABS and AUR databases against repositories | -| yaupd | yaourt -Sy && sudo abs | Update and refresh the local package and ABS databases against repositories | -| yaupd | yaourt -Sy && sudo aur | Update and refresh the local package and AUR databases against repositories | -| yaupd | yaourt -Sy | Update and refresh the local package database against repositories | -| yaupg | yaourt -Syua | Synchronize with repositories before upgrading packages (AUR packages too) that are out of date on the local system | - -| Function | Description | -|----------------|:------------------------------------------------------------------------------------------------------------------| -| pacdisowned | List all disowned files in your system | -| paclist | List all installed packages with a short description - [Source](https://bbs.archlinux.org/viewtopic.php?id=93683) | -| pacmanallkeys | Get all keys for developers and trusted users | -| pacmansignkeys | | - ---- - -### CONTRIBUTORS - - Benjamin Boudreau - dreurmail@gmail.com - - Celso Miranda - contacto@celsomiranda.net - - KhasMek - Boushh@gmail.com - - Martin Putniorz - mputniorz@gmail.com - - MatthR3D - matthr3d@gmail.com - - ornicar - thibault.duplessis@gmail.com - ---- +- Benjamin Boudreau - dreurmail@gmail.com +- Celso Miranda - contacto@celsomiranda.net +- KhasMek - Boushh@gmail.com +- Martin Putniorz - mputniorz@gmail.com +- MatthR3D - matthr3d@gmail.com +- ornicar - thibault.duplessis@gmail.com From 3ba52562d9bda171ef7986a2ee9e801ba416bbef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Wed, 24 Aug 2016 08:51:06 +0200 Subject: [PATCH 39/56] archlinux: fix pacmanallkeys URL, make curl silent Also make all functions local as to not spill variables into the global namespace. --- plugins/archlinux/archlinux.plugin.zsh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plugins/archlinux/archlinux.plugin.zsh b/plugins/archlinux/archlinux.plugin.zsh index ef862f14c..9c8c984b1 100644 --- a/plugins/archlinux/archlinux.plugin.zsh +++ b/plugins/archlinux/archlinux.plugin.zsh @@ -68,6 +68,8 @@ paclist() { } pacdisowned() { + emulate -L zsh + tmp=${TMPDIR-/tmp}/pacman-disowned-$UID-$$ db=$tmp/db fs=$tmp/fs @@ -84,12 +86,14 @@ pacdisowned() { } pacmanallkeys() { - curl https://www.archlinux.org/{developers,trustedusers}/ | \ + emulate -L zsh + curl -s https://www.archlinux.org/people/{developers,trustedusers}/ | \ awk -F\" '(/pgp.mit.edu/) { sub(/.*search=0x/,""); print $1}' | \ xargs sudo pacman-key --recv-keys } pacmansignkeys() { + emulate -L zsh for key in $*; do sudo pacman-key --recv-keys $key sudo pacman-key --lsign-key $key From 7b1d51a2d7309e590da108f11608e3d1a8682254 Mon Sep 17 00:00:00 2001 From: Ivan Eisenberg Date: Wed, 24 Aug 2016 13:02:27 -0500 Subject: [PATCH 40/56] Added documentation for undocumented OSX plugin commands (#5338) * updated OSX plugin docs --- plugins/osx/README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugins/osx/README.md b/plugins/osx/README.md index 6de2b061e..0fcd23dd5 100644 --- a/plugins/osx/README.md +++ b/plugins/osx/README.md @@ -18,6 +18,8 @@ Original author: [Sorin Ionescu](https://github.com/sorin-ionescu) | Command | Description | | :-------------- | :----------------------------------------------- | | `tab` | Open the current directory in a new tab | +| `split_tab` | Split the current terminal tab horizontally | +| `vsplit_tab` | Split the current terminal tab vertically | | `ofd` | Open the current directory in a Finder window | | `pfd` | Return the path of the frontmost Finder window | | `pfs` | Return the current Finder selection | @@ -27,3 +29,4 @@ Original author: [Sorin Ionescu](https://github.com/sorin-ionescu) | `man-preview` | Open a specified man page in Preview app | | `showfiles` | Show hidden files | | `hidefiles` | Hide the hidden files | +| `itunes` | Control iTunes. User `itunes -h` for usage details | From fbd6bbb686ddf1b79a7a076cd3ea096c0b77bc5a Mon Sep 17 00:00:00 2001 From: Multilul Date: Wed, 24 Aug 2016 21:15:12 +0200 Subject: [PATCH 41/56] iTerm2 v3 tab commands fixes (#5336) Fixes the "syntax error: expected line end ..." (-2741) when using the tab, split_tab and vsplit_tab commands in iTerm2 v3 --- plugins/osx/osx.plugin.zsh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/osx/osx.plugin.zsh b/plugins/osx/osx.plugin.zsh index f69bd7e5d..a3e550972 100644 --- a/plugins/osx/osx.plugin.zsh +++ b/plugins/osx/osx.plugin.zsh @@ -44,7 +44,7 @@ EOF elif [[ "$the_app" == 'iTerm2' ]]; then osascript < Date: Mon, 28 Apr 2014 09:00:52 +0200 Subject: [PATCH 42/56] adding tig plugin for oh-my-zsh --- plugins/tig/tig.plugin.zsh | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 plugins/tig/tig.plugin.zsh diff --git a/plugins/tig/tig.plugin.zsh b/plugins/tig/tig.plugin.zsh new file mode 100644 index 000000000..1d2a4d5c9 --- /dev/null +++ b/plugins/tig/tig.plugin.zsh @@ -0,0 +1,6 @@ +alias tis='tig status' +alias til='tig log' + +# blame a single file and list commits +alias tib='tig blame -C' + From a3a6dc31fbf4e3eafc65ff6fee3fa5d69b20b05f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Wed, 24 Aug 2016 21:27:18 +0200 Subject: [PATCH 43/56] Add README to tig plugin --- plugins/tig/README.md | 16 ++++++++++++++++ plugins/tig/tig.plugin.zsh | 3 --- 2 files changed, 16 insertions(+), 3 deletions(-) create mode 100644 plugins/tig/README.md diff --git a/plugins/tig/README.md b/plugins/tig/README.md new file mode 100644 index 000000000..bb24cd147 --- /dev/null +++ b/plugins/tig/README.md @@ -0,0 +1,16 @@ +# `tig` plugin + +This plugin adds some aliases for people who work with `tig` in +a regular basis. To use it, add `tig` to your plugins array: + +```zsh +plugins=(... tig) +``` + +## Features + +| Alias | Command | Description | +|-------|----------------|-------------------------------------------------| +| `tis` | `tig status` | Show git status | +| `til` | `tig log` | Show git log | +| `tib` | `tig blame -C` | `git-blame` a file detecting copies and renames | diff --git a/plugins/tig/tig.plugin.zsh b/plugins/tig/tig.plugin.zsh index 1d2a4d5c9..7e0c530ac 100644 --- a/plugins/tig/tig.plugin.zsh +++ b/plugins/tig/tig.plugin.zsh @@ -1,6 +1,3 @@ alias tis='tig status' alias til='tig log' - -# blame a single file and list commits alias tib='tig blame -C' - From 43cae980faeda0ab2685f7f2fd2e598480b64a37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Thu, 25 Aug 2016 02:05:25 +0200 Subject: [PATCH 44/56] init script: remove trailing slash from $ZSH_CACHE_DIR --- oh-my-zsh.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh index 6cc5ac630..ed258f0ea 100644 --- a/oh-my-zsh.sh +++ b/oh-my-zsh.sh @@ -22,7 +22,7 @@ fi # Set ZSH_CACHE_DIR to the path where cache files should be created # or else we will use the default cache/ if [[ -z "$ZSH_CACHE_DIR" ]]; then - ZSH_CACHE_DIR="$ZSH/cache/" + ZSH_CACHE_DIR="$ZSH/cache" fi From 0c0fcdace5e50b48512e9232bb64fe24411c0644 Mon Sep 17 00:00:00 2001 From: Andrew Janke Date: Tue, 24 Feb 2015 12:12:33 -0500 Subject: [PATCH 45/56] cask: check for Homebrew path for completion file --- plugins/cask/cask.plugin.zsh | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/plugins/cask/cask.plugin.zsh b/plugins/cask/cask.plugin.zsh index c55862924..bc0006d9f 100644 --- a/plugins/cask/cask.plugin.zsh +++ b/plugins/cask/cask.plugin.zsh @@ -1,5 +1,21 @@ -if which cask &> /dev/null; then - source $(dirname $(which cask))/../etc/cask_completion.zsh -else - print "zsh cask plugin: cask not found" -fi +() { + if which cask &> /dev/null; then + local cask_bin cask_base f comp_files + cask_bin=$(which cask) + cask_base=${cask_bin:h:h} + # Plain cask installation location (for Cask 0.7.2 and earlier) + comp_files=( $cask_base/etc/cask_completion.zsh ) + # Mac Homebrew installs the completion in a different location + if which brew &> /dev/null; then + comp_files+=`brew --prefix`/share/zsh/site-functions/cask_completion.zsh + fi + for f in $comp_files; do + if [[ -f $f ]]; then + source $f; + break; + fi + done + else + print "zsh cask plugin: cask not found" + fi +} \ No newline at end of file From a822fefecfbf2e93e475867b471b4d2541550e94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Fri, 12 Feb 2016 18:55:53 +0100 Subject: [PATCH 46/56] Style fixes and shorter command lookup --- plugins/cask/cask.plugin.zsh | 43 ++++++++++++++++++++---------------- 1 file changed, 24 insertions(+), 19 deletions(-) diff --git a/plugins/cask/cask.plugin.zsh b/plugins/cask/cask.plugin.zsh index bc0006d9f..29120b306 100644 --- a/plugins/cask/cask.plugin.zsh +++ b/plugins/cask/cask.plugin.zsh @@ -1,21 +1,26 @@ () { - if which cask &> /dev/null; then - local cask_bin cask_base f comp_files - cask_bin=$(which cask) - cask_base=${cask_bin:h:h} - # Plain cask installation location (for Cask 0.7.2 and earlier) - comp_files=( $cask_base/etc/cask_completion.zsh ) - # Mac Homebrew installs the completion in a different location - if which brew &> /dev/null; then - comp_files+=`brew --prefix`/share/zsh/site-functions/cask_completion.zsh - fi - for f in $comp_files; do - if [[ -f $f ]]; then - source $f; - break; - fi - done - else - print "zsh cask plugin: cask not found" + emulate -L zsh + + if ! (( $+commands[cask] )); then + print "zsh cask plugin: cask command not found" >&2 + return fi -} \ No newline at end of file + + cask_base=${commands[cask]:h:h} + + # Plain cask installation location (for Cask 0.7.2 and earlier) + comp_files=($cask_base/etc/cask_completion.zsh) + + # Mac Homebrew installs the completion in a different location + if (( $+commands[brew] )); then + comp_files+=($(brew --prefix)/share/zsh/site-functions/cask_completion.zsh) + fi + + # Load first found file + for f in $comp_files; do + if [[ -f "$f" ]]; then + source "$f" + break + fi + done +} From cc455074266c4270174ff706f3a300677a8b3470 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Thu, 25 Aug 2016 18:33:15 +0200 Subject: [PATCH 47/56] Add README to cask plugin --- plugins/cask/README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 plugins/cask/README.md diff --git a/plugins/cask/README.md b/plugins/cask/README.md new file mode 100644 index 000000000..6457fd858 --- /dev/null +++ b/plugins/cask/README.md @@ -0,0 +1,11 @@ +# cask plugin + +Loads `cask` completion from non-standard locations, such as if installed +via Homebrew or others. To enable it, add `cask` to your plugins array: + +```zsh +plugins=(... cask) +``` + +Make sure you have the `cask` directory in your `$PATH` before loading +Oh My Zsh, otherwise you'll get the "command not found" error. From b1ff2d57579c6f59a9da904db5c1538bbc1f0509 Mon Sep 17 00:00:00 2001 From: Kevin Ndung'u Date: Fri, 26 Aug 2016 22:41:16 +0300 Subject: [PATCH 48/56] Disable zsh file globbing when running pip (#5348) --- plugins/pip/pip.plugin.zsh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugins/pip/pip.plugin.zsh b/plugins/pip/pip.plugin.zsh index b5433ae9d..d7236b02a 100644 --- a/plugins/pip/pip.plugin.zsh +++ b/plugins/pip/pip.plugin.zsh @@ -76,3 +76,6 @@ zsh-pip-test-clean-packages() { echo "the djangopypi2 index is fine" fi } + +alias pip="noglob pip" # allows square brackets for pip command invocation + From f63ec67291d8ad3ef3e6626076a69e82c12cf1ac Mon Sep 17 00:00:00 2001 From: Rory Hardy Date: Fri, 26 Aug 2016 15:05:33 -0500 Subject: [PATCH 49/56] Added perms plugin (#1752) * Added perms plugin * HTTPS -> HTTP for comment URL * Added a README * Updated TOF comment * Pulled in updates by apjanke with minor tweaks --- plugins/perms/README.md | 9 ++++ plugins/perms/perms.plugin.zsh | 78 ++++++++++++++++++++++++++++++++++ 2 files changed, 87 insertions(+) create mode 100644 plugins/perms/README.md create mode 100644 plugins/perms/perms.plugin.zsh diff --git a/plugins/perms/README.md b/plugins/perms/README.md new file mode 100644 index 000000000..873c21d42 --- /dev/null +++ b/plugins/perms/README.md @@ -0,0 +1,9 @@ +## Perms + +Plugin to handle some unix filesystem permissions quickly + +### Usage + +* `set755` recursively sets all directories located within the current working directory and sub directories to octal 755. +* `set644` recursively sets all files located within the current working directory and sub directories to octal 644. +* `fixperms` is a wrapper around `set755` and `set644` applied to a specified directory or the current directory otherwise. It also prompts prior to execution unlike the other two aliases. \ No newline at end of file diff --git a/plugins/perms/perms.plugin.zsh b/plugins/perms/perms.plugin.zsh new file mode 100644 index 000000000..81f56d577 --- /dev/null +++ b/plugins/perms/perms.plugin.zsh @@ -0,0 +1,78 @@ +# Some useful commands for setting permissions. +# +# Rory Hardy [GneatGeek] +# Andrew Janke [apjanke] + +### Aliases + +# Set all files' permissions to 644 recursively in a directory +alias set644='find . -type f -print0 | xargs -0 chmod 644' + +# Set all directories' permissions to 755 recursively in a directory +alias set755='find . -type d -print0 | xargs -0 chmod 755' + +### Functions + +# fixperms - fix permissions on files and directories, with confirmation +# Returns 0 on success, nonzero if any errors occurred +fixperms () { + local opts confirm target exit_status chmod_opts use_slow_mode + zparseopts -E -D -a opts -help -slow v+=chmod_opts + if [[ $# > 1 || -n "${opts[(r)--help]}" ]]; then + cat < 1 )) + return $exit_status + fi + + if [[ $# == 0 ]]; then + target="." + else + target="$1" + fi + if [[ -n ${opts[(r)--slow]} ]]; then use_slow=true; else use_slow=false; fi + + # Because this requires confirmation, bail in noninteractive shells + if [[ ! -o interactive ]]; then + echo "fixperms: cannot run in noninteractive shell" + return 1 + fi + + echo "Fixing perms on $target?" + printf '%s' "Proceed? (y|n) " + read confirm + if [[ "$confirm" != y ]]; then + # User aborted + return 1 + fi + + # This xargs form is faster than -exec chmod {} \; but will encounter + # issues if the directories themselves have permissions such that you can't + # recurse in to them. If that happens, just rerun this a few times. + exit_status=0; + if [[ $use_slow == true ]]; then + # Process directories first so non-traversable ones are fixed as we go + find "$target" -type d -exec chmod $chmod_opts 755 {} \; + if [[ $? != 0 ]]; then exit_status=$?; fi + find "$target" -type f -exec chmod $chmod_opts 644 {} \; + if [[ $? != 0 ]]; then exit_status=$?; fi + else + find "$target" -type d -print0 | xargs -0 chmod $chmod_opts 755 + if [[ $? != 0 ]]; then exit_status=$?; fi + find "$target" -type f -print0 | xargs -0 chmod $chmod_opts 644 + if [[ $? != 0 ]]; then exit_status=$?; fi + fi + echo "Complete" + return $exit_status +} From d2c355593e6ae1f21adacefefd44f615939fbd38 Mon Sep 17 00:00:00 2001 From: Aleksey Ivanov Date: Sun, 21 Aug 2016 19:50:44 +0200 Subject: [PATCH 50/56] Fix _tasks_changed algorithm in rake-fast plugin --- plugins/rake-fast/rake-fast.plugin.zsh | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/plugins/rake-fast/rake-fast.plugin.zsh b/plugins/rake-fast/rake-fast.plugin.zsh index 57d699abc..411d25726 100644 --- a/plugins/rake-fast/rake-fast.plugin.zsh +++ b/plugins/rake-fast/rake-fast.plugin.zsh @@ -16,11 +16,16 @@ _is_rails_app () { } _tasks_changed () { - local is_changed=1 - for file in lib/tasks/**/*.rake; do - if [[ $file -nt .rake_tasks ]]; then is_changed=0; fi + local -a paths + paths=(lib/tasks lib/tasks/**/*(N)) + + for path in $paths; do + if [[ "$path" -nt .rake_tasks ]]; then + return 0 + fi done - return is_changed + + return 1 } _rake_generate () { From fe526c7bfc5fb11f92e22337dd461db1cd942e46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Sun, 21 Aug 2016 19:51:08 +0200 Subject: [PATCH 51/56] Fix syntax and formatting of rake-fast plugin --- plugins/rake-fast/rake-fast.plugin.zsh | 29 ++++++++++++-------------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/plugins/rake-fast/rake-fast.plugin.zsh b/plugins/rake-fast/rake-fast.plugin.zsh index 411d25726..a594ca923 100644 --- a/plugins/rake-fast/rake-fast.plugin.zsh +++ b/plugins/rake-fast/rake-fast.plugin.zsh @@ -1,18 +1,9 @@ -_rake_refresh () { - if [ -f .rake_tasks ]; then - rm .rake_tasks - fi - echo "Generating .rake_tasks..." > /dev/stderr - _rake_generate - cat .rake_tasks -} - _rake_does_task_list_need_generating () { - [[ ! -f .rake_tasks ]] || [[ Rakefile -nt .rake_tasks ]] || (_is_rails_app && _tasks_changed) + [[ ! -f .rake_tasks ]] || [[ Rakefile -nt .rake_tasks ]] || { _is_rails_app && _tasks_changed } } _is_rails_app () { - [[ -e "bin/rails" ]] || [ -e "script/rails" ] + [[ -e "bin/rails" ]] || [[ -e "script/rails" ]] } _tasks_changed () { @@ -33,14 +24,20 @@ _rake_generate () { } _rake () { - if [ -f Rakefile ]; then + if [[ -f Rakefile ]]; then if _rake_does_task_list_need_generating; then - echo "\nGenerating .rake_tasks..." > /dev/stderr + echo "\nGenerating .rake_tasks..." >&2 _rake_generate fi - compadd `cat .rake_tasks` + compadd $(cat .rake_tasks) fi } - compdef _rake rake -alias rake_refresh='_rake_refresh' + +rake_refresh () { + [[ -f .rake_tasks ]] && rm -f .rake_tasks + + echo "Generating .rake_tasks..." >&2 + _rake_generate + cat .rake_tasks +} From 1a1daba6d298a83333c35d1725843f6eac755b36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Sun, 21 Aug 2016 20:02:55 +0200 Subject: [PATCH 52/56] Reword rake-fast README, add `lib/tasks` information --- plugins/rake-fast/README.md | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/plugins/rake-fast/README.md b/plugins/rake-fast/README.md index f56142f69..1417befa1 100644 --- a/plugins/rake-fast/README.md +++ b/plugins/rake-fast/README.md @@ -2,22 +2,34 @@ Fast rake autocompletion plugin. -This script caches the output for later usage and significantly speeds it up. It generates a .rake_tasks cache file in parallel to the Rakefile. It also checks the file modification dates to see if it needs to regenerate the cache file. +This plugin caches the output for later usage and significantly speeds it up. +It generates a `.rake_tasks` cache file in parallel to the Rakefile. It also +checks the file modification time to see if it needs to regenerate the cache +file. -This is entirely based on [this pull request by Ullrich Schäfer](https://github.com/robb/.dotfiles/pull/10/), which is inspired by [this Ruby on Rails trick from 2006](http://weblog.rubyonrails.org/2006/3/9/fast-rake-task-completion-for-zsh/). +This is entirely based on [this pull request by Ullrich Schäfer](https://github.com/robb/.dotfiles/pull/10/), +which is inspired by [this Ruby on Rails trick from 2006](http://weblog.rubyonrails.org/2006/3/9/fast-rake-task-completion-for-zsh/). Think about that. 2006. +---------- + +Since August of 2016, it also checks if it's in a Rails project and looks at +rake files inside `lib/tasks` and their modification time to know if the +cache file needs to be regenerated. + ## Installation Just add the plugin to your `.zshrc`: -```bash -plugins=(foo bar rake-fast) +```zsh +plugins=(... rake-fast) ``` You might consider adding `.rake_tasks` to your [global .gitignore](https://help.github.com/articles/ignoring-files#global-gitignore) ## Usage -`rake`, then press tab +Type `rake`, then press tab. + +If you want to force the regeneration of the `.rake_tasks` file, run `rake_refresh`. From e5cb3705dd6f66804039709f3828e7a07ae501f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Mon, 29 Aug 2016 08:37:09 +0200 Subject: [PATCH 53/56] rake-fast: change variable name from `$path' to `$file' This solves a problem of using the variable name `$path' which then smashes the environment variable `$PATH' and messes up the session. See https://github.com/robbyrussell/oh-my-zsh/pull/5343#issuecomment-243043098 --- plugins/rake-fast/rake-fast.plugin.zsh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/rake-fast/rake-fast.plugin.zsh b/plugins/rake-fast/rake-fast.plugin.zsh index a594ca923..ca80d86e1 100644 --- a/plugins/rake-fast/rake-fast.plugin.zsh +++ b/plugins/rake-fast/rake-fast.plugin.zsh @@ -7,11 +7,11 @@ _is_rails_app () { } _tasks_changed () { - local -a paths - paths=(lib/tasks lib/tasks/**/*(N)) + local -a files + files=(lib/tasks lib/tasks/**/*(N)) - for path in $paths; do - if [[ "$path" -nt .rake_tasks ]]; then + for file in $files; do + if [[ "$file" -nt .rake_tasks ]]; then return 0 fi done From 693c052e570682718c63a2fe3237447a37d981bb Mon Sep 17 00:00:00 2001 From: Fabio Fernandes Date: Sat, 13 Jul 2013 05:27:37 -0300 Subject: [PATCH 54/56] Add Droplr plugin --- plugins/droplr/droplr.plugin.zsh | 3 +++ plugins/droplr/droplr.rb | 25 +++++++++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 plugins/droplr/droplr.plugin.zsh create mode 100755 plugins/droplr/droplr.rb diff --git a/plugins/droplr/droplr.plugin.zsh b/plugins/droplr/droplr.plugin.zsh new file mode 100644 index 000000000..a20ca9368 --- /dev/null +++ b/plugins/droplr/droplr.plugin.zsh @@ -0,0 +1,3 @@ +#!/bin/zsh + +alias droplr=$ZSH/plugins/droplr/droplr.rb \ No newline at end of file diff --git a/plugins/droplr/droplr.rb b/plugins/droplr/droplr.rb new file mode 100755 index 000000000..38751dfcb --- /dev/null +++ b/plugins/droplr/droplr.rb @@ -0,0 +1,25 @@ +#!/usr/bin/env ruby +# +# droplr +# Fabio Fernandes | http://fabiofl.me +# +# Use Droplr from the comand line to upload files and shorten links. +# +# Examples: +# +# droplr ./path/to/file/ +# droplr http://example.com +# +# This needs Droplr.app to be installed and loged in. +# Also, Mac only. + +if ARGV[0].nil? + puts "You need to specify a parameter." + exit!(1) +end + +if ARGV[0][%r{^http[|s]://}i] + `osascript -e 'tell app "Droplr" to shorten "#{ARGV[0]}"'` +else + `open -ga /Applications/Droplr.app "#{ARGV[0]}"` +end \ No newline at end of file From 2f4d721c1fe0ee9f5ec6894819de63de3c672147 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Fri, 2 Sep 2016 20:25:28 +0200 Subject: [PATCH 55/56] Add Droplr README --- plugins/droplr/README.md | 19 +++++++++++++++++++ plugins/droplr/droplr.plugin.zsh | 4 +--- plugins/droplr/droplr.rb | 15 +-------------- 3 files changed, 21 insertions(+), 17 deletions(-) create mode 100644 plugins/droplr/README.md diff --git a/plugins/droplr/README.md b/plugins/droplr/README.md new file mode 100644 index 000000000..cfbec25ed --- /dev/null +++ b/plugins/droplr/README.md @@ -0,0 +1,19 @@ +# droplr + +Use [Droplr](https://droplr.com/) from the comand line to upload files and shorten +links. It needs to have [Droplr.app](https://droplr.com/apps) installed and logged +in. MacOS only. + +To use it, add `droplr` to the `$plugins` variable in your zshrc file: + +```zsh +plugins=(... droplr) +``` + +Author: [Fabio Fernandes](https://github.com/fabiofl) + +## Examples + +- Upload a file: `droplr ./path/to/file/` + +- Shorten a link: `droplr http://example.com` diff --git a/plugins/droplr/droplr.plugin.zsh b/plugins/droplr/droplr.plugin.zsh index a20ca9368..2a2ec227c 100644 --- a/plugins/droplr/droplr.plugin.zsh +++ b/plugins/droplr/droplr.plugin.zsh @@ -1,3 +1 @@ -#!/bin/zsh - -alias droplr=$ZSH/plugins/droplr/droplr.rb \ No newline at end of file +alias droplr=$ZSH/plugins/droplr/droplr.rb diff --git a/plugins/droplr/droplr.rb b/plugins/droplr/droplr.rb index 38751dfcb..00300198e 100755 --- a/plugins/droplr/droplr.rb +++ b/plugins/droplr/droplr.rb @@ -1,17 +1,4 @@ #!/usr/bin/env ruby -# -# droplr -# Fabio Fernandes | http://fabiofl.me -# -# Use Droplr from the comand line to upload files and shorten links. -# -# Examples: -# -# droplr ./path/to/file/ -# droplr http://example.com -# -# This needs Droplr.app to be installed and loged in. -# Also, Mac only. if ARGV[0].nil? puts "You need to specify a parameter." @@ -22,4 +9,4 @@ if ARGV[0][%r{^http[|s]://}i] `osascript -e 'tell app "Droplr" to shorten "#{ARGV[0]}"'` else `open -ga /Applications/Droplr.app "#{ARGV[0]}"` -end \ No newline at end of file +end From f6d1773fd5f79b300cceb842b385256b3a754508 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Fri, 2 Sep 2016 21:01:31 +0200 Subject: [PATCH 56/56] droplr: convert ruby file into zsh --- plugins/droplr/droplr.plugin.zsh | 16 +++++++++++++++- plugins/droplr/droplr.rb | 12 ------------ 2 files changed, 15 insertions(+), 13 deletions(-) delete mode 100755 plugins/droplr/droplr.rb diff --git a/plugins/droplr/droplr.plugin.zsh b/plugins/droplr/droplr.plugin.zsh index 2a2ec227c..296a8b98b 100644 --- a/plugins/droplr/droplr.plugin.zsh +++ b/plugins/droplr/droplr.plugin.zsh @@ -1 +1,15 @@ -alias droplr=$ZSH/plugins/droplr/droplr.rb +# Only compatible with MacOS +[[ "$OSTYPE" == darwin* ]] || return + +droplr() { + if [[ $# -eq 0 ]]; then + echo You need to specify a parameter. >&2 + return 1 + fi + + if [[ "$1" =~ ^http[|s]:// ]]; then + osascript -e "tell app 'Droplr' to shorten '$1'" + else + open -ga /Applications/Droplr.app "$1" + fi +} diff --git a/plugins/droplr/droplr.rb b/plugins/droplr/droplr.rb deleted file mode 100755 index 00300198e..000000000 --- a/plugins/droplr/droplr.rb +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env ruby - -if ARGV[0].nil? - puts "You need to specify a parameter." - exit!(1) -end - -if ARGV[0][%r{^http[|s]://}i] - `osascript -e 'tell app "Droplr" to shorten "#{ARGV[0]}"'` -else - `open -ga /Applications/Droplr.app "#{ARGV[0]}"` -end