From 96d10e2147b59adc25e9c3b90ac6f31935495ef3 Mon Sep 17 00:00:00 2001 From: Robert Strack Date: Fri, 13 Nov 2015 23:42:21 -0500 Subject: calculating command's execution time --- plugins/timer/timer.plugin.zsh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 plugins/timer/timer.plugin.zsh (limited to 'plugins') diff --git a/plugins/timer/timer.plugin.zsh b/plugins/timer/timer.plugin.zsh new file mode 100644 index 000000000..aa4573b9f --- /dev/null +++ b/plugins/timer/timer.plugin.zsh @@ -0,0 +1,18 @@ +preexec() { + __timer_cmd_start_time=$(date '+%s') +} + +precmd() { + if [ -n "${__timer_cmd_start_time}" ]; then + local cmd_end_time=$(date '+%s') + local tdiff=$((${cmd_end_time} - ${__timer_cmd_start_time})) + unset __timer_cmd_start_time + local tdiffstr='/' + if (( tdiff >= 60 )); then + tdiffstr+="$((tdiff / 60))m" + fi + tdiffstr+="$((tdiff % 60))s" + local cols=$(($COLUMNS - ${#tdiffstr} - 1)) + echo -e "\033[1A\033[${cols}C ${tdiffstr}" + fi +} -- cgit v1.2.3-70-g09d2 From 1b8f05a3d395c107d81724445cac7fcd599942d8 Mon Sep 17 00:00:00 2001 From: Robert Strack Date: Sat, 14 Nov 2015 23:13:44 -0500 Subject: simplified time string calculation --- plugins/timer/timer.plugin.zsh | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'plugins') diff --git a/plugins/timer/timer.plugin.zsh b/plugins/timer/timer.plugin.zsh index aa4573b9f..f73d2ab53 100644 --- a/plugins/timer/timer.plugin.zsh +++ b/plugins/timer/timer.plugin.zsh @@ -7,12 +7,8 @@ precmd() { local cmd_end_time=$(date '+%s') local tdiff=$((${cmd_end_time} - ${__timer_cmd_start_time})) unset __timer_cmd_start_time - local tdiffstr='/' - if (( tdiff >= 60 )); then - tdiffstr+="$((tdiff / 60))m" - fi - tdiffstr+="$((tdiff % 60))s" - local cols=$(($COLUMNS - ${#tdiffstr} - 1)) - echo -e "\033[1A\033[${cols}C ${tdiffstr}" + local tdiffstr="$((tdiff / 60))m$((tdiff % 60))s" + local cols=$(($COLUMNS - ${#tdiffstr#0m} - 2)) + echo -e "\033[1A\033[${cols}C \`${tdiffstr#0m}" fi } -- cgit v1.2.3-70-g09d2 From 120e8620af6e1d7d01159614186403c7a816457d Mon Sep 17 00:00:00 2001 From: Robert Strack Date: Sat, 14 Nov 2015 23:48:26 -0500 Subject: cleaning up --- plugins/timer/timer.plugin.zsh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'plugins') diff --git a/plugins/timer/timer.plugin.zsh b/plugins/timer/timer.plugin.zsh index f73d2ab53..ee2cb66c1 100644 --- a/plugins/timer/timer.plugin.zsh +++ b/plugins/timer/timer.plugin.zsh @@ -3,12 +3,12 @@ preexec() { } precmd() { - if [ -n "${__timer_cmd_start_time}" ]; then + if [ -n "$__timer_cmd_start_time" ]; then local cmd_end_time=$(date '+%s') - local tdiff=$((${cmd_end_time} - ${__timer_cmd_start_time})) + local tdiff=$((cmd_end_time - __timer_cmd_start_time)) unset __timer_cmd_start_time local tdiffstr="$((tdiff / 60))m$((tdiff % 60))s" - local cols=$(($COLUMNS - ${#tdiffstr#0m} - 2)) + local cols=$((COLUMNS - ${#tdiffstr#0m} - 2)) echo -e "\033[1A\033[${cols}C \`${tdiffstr#0m}" fi } -- cgit v1.2.3-70-g09d2 From d4c74690b61b74e317410df3b80b784891ab55ed Mon Sep 17 00:00:00 2001 From: Robert Strack Date: Sun, 15 Nov 2015 22:08:16 -0500 Subject: increased timer's pecision --- plugins/timer/timer.plugin.zsh | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) (limited to 'plugins') diff --git a/plugins/timer/timer.plugin.zsh b/plugins/timer/timer.plugin.zsh index ee2cb66c1..729dd3ee2 100644 --- a/plugins/timer/timer.plugin.zsh +++ b/plugins/timer/timer.plugin.zsh @@ -1,14 +1,25 @@ +__timer_current_time() { + perl -MTime::HiRes=time -e'print time' +} + +__timer_format_duration() { + local mins=$(printf '%.0f' $(($1 / 60))) + local secs=$(printf '%.1f' $(($1 - 60 * mins))) + local duration_str=$(echo "${mins}m${secs}s") + echo "\`${duration_str#0m}" +} + preexec() { - __timer_cmd_start_time=$(date '+%s') + __timer_cmd_start_time=$(__timer_current_time) } precmd() { - if [ -n "$__timer_cmd_start_time" ]; then - local cmd_end_time=$(date '+%s') + if [ -n "${__timer_cmd_start_time}" ]; then + local cmd_end_time=$(__timer_current_time) local tdiff=$((cmd_end_time - __timer_cmd_start_time)) unset __timer_cmd_start_time - local tdiffstr="$((tdiff / 60))m$((tdiff % 60))s" - local cols=$((COLUMNS - ${#tdiffstr#0m} - 2)) - echo -e "\033[1A\033[${cols}C \`${tdiffstr#0m}" + local tdiffstr=$(__timer_format_duration ${tdiff}) + local cols=$((COLUMNS - ${#tdiffstr} - 1)) + echo -e "\033[1A\033[${cols}C ${tdiffstr}" fi } -- cgit v1.2.3-70-g09d2 From 111dd018b9b821fad2c7899b31aa46b5c0aaa218 Mon Sep 17 00:00:00 2001 From: Robert Strack Date: Mon, 16 Nov 2015 22:20:26 -0500 Subject: allow changes in display format --- plugins/timer/timer.plugin.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'plugins') diff --git a/plugins/timer/timer.plugin.zsh b/plugins/timer/timer.plugin.zsh index 729dd3ee2..33481ea4e 100644 --- a/plugins/timer/timer.plugin.zsh +++ b/plugins/timer/timer.plugin.zsh @@ -4,9 +4,9 @@ __timer_current_time() { __timer_format_duration() { local mins=$(printf '%.0f' $(($1 / 60))) - local secs=$(printf '%.1f' $(($1 - 60 * mins))) + local secs=$(printf "%.${TIMER_PRECISION:-1}f" $(($1 - 60 * mins))) local duration_str=$(echo "${mins}m${secs}s") - echo "\`${duration_str#0m}" + echo "${TIMER_SYMBOL:-\`}${duration_str#0m}" } preexec() { -- cgit v1.2.3-70-g09d2 From 96148d2275b848dbfb976a58967535067def4210 Mon Sep 17 00:00:00 2001 From: Robert Strack Date: Tue, 17 Nov 2015 20:50:30 -0500 Subject: customizable timer format --- plugins/timer/timer.plugin.zsh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'plugins') diff --git a/plugins/timer/timer.plugin.zsh b/plugins/timer/timer.plugin.zsh index 33481ea4e..f7f039b78 100644 --- a/plugins/timer/timer.plugin.zsh +++ b/plugins/timer/timer.plugin.zsh @@ -6,7 +6,8 @@ __timer_format_duration() { local mins=$(printf '%.0f' $(($1 / 60))) local secs=$(printf "%.${TIMER_PRECISION:-1}f" $(($1 - 60 * mins))) local duration_str=$(echo "${mins}m${secs}s") - echo "${TIMER_SYMBOL:-\`}${duration_str#0m}" + local format="${TIMER_FORMAT:-/%d}" + echo "${format//\%d/${duration_str#0m}}" } preexec() { -- cgit v1.2.3-70-g09d2 From de8d6841b00903f2873a8b009faf7002bfbc1273 Mon Sep 17 00:00:00 2001 From: Robert Strack Date: Wed, 18 Nov 2015 20:33:38 -0500 Subject: added pre_functions --- plugins/timer/timer.plugin.zsh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'plugins') diff --git a/plugins/timer/timer.plugin.zsh b/plugins/timer/timer.plugin.zsh index f7f039b78..231134e7d 100644 --- a/plugins/timer/timer.plugin.zsh +++ b/plugins/timer/timer.plugin.zsh @@ -10,11 +10,11 @@ __timer_format_duration() { echo "${format//\%d/${duration_str#0m}}" } -preexec() { +__timer_save_time_preexec() { __timer_cmd_start_time=$(__timer_current_time) } -precmd() { +__timer_display_timer_precmd() { if [ -n "${__timer_cmd_start_time}" ]; then local cmd_end_time=$(__timer_current_time) local tdiff=$((cmd_end_time - __timer_cmd_start_time)) @@ -24,3 +24,6 @@ precmd() { echo -e "\033[1A\033[${cols}C ${tdiffstr}" fi } + +preexec_functions+=(__timer_save_time_preexec) +precmd_functions+=(__timer_display_timer_precmd) -- cgit v1.2.3-70-g09d2 From d615961430aca9668cfb056aef6024c4ed41eff8 Mon Sep 17 00:00:00 2001 From: Robert Strack Date: Wed, 18 Nov 2015 21:09:18 -0500 Subject: readme file --- plugins/timer/README.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 plugins/timer/README.md (limited to 'plugins') diff --git a/plugins/timer/README.md b/plugins/timer/README.md new file mode 100644 index 000000000..19072cb24 --- /dev/null +++ b/plugins/timer/README.md @@ -0,0 +1,18 @@ +This plugin allows to display command's execution time in a very nonintrusive way. + +Timer can be tuned by these two variables: +* `TIMER_PRECISION` allows to control number of decimal places (default `1`) +* `TIMER_FORMAT` allows to adjust display format (default `'/%d'`) + +Sample session: + + me@here:~$ sleep 1 /1.0s + me@here:~$ sleep 73 /1m13.0s + me@here:~$ TIMER_FORMAT='[%d]'; TIMER_PRECISION=2 [0.00s] + me@here:~$ head -c50 < /dev/urandom | hexdump + 0000000 b2 16 20 f0 29 1f 61 2d 8a 29 20 8c 8c 39 5a ab + 0000010 21 47 0e f9 ee a4 76 46 71 9e 4f 6b a4 c4 51 cb + 0000020 f9 1f 7e b9 6f 2c ae dd cf 40 6d 64 a8 fb d3 db + 0000030 09 37 + 0000032 [0.02s] + -- cgit v1.2.3-70-g09d2 From 7553bcb4185b9d584a40b41cf15501e43041fe57 Mon Sep 17 00:00:00 2001 From: Robert Strack Date: Wed, 18 Nov 2015 21:27:29 -0500 Subject: minor corrections in the readme file --- plugins/timer/README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'plugins') diff --git a/plugins/timer/README.md b/plugins/timer/README.md index 19072cb24..321307e59 100644 --- a/plugins/timer/README.md +++ b/plugins/timer/README.md @@ -8,11 +8,10 @@ Sample session: me@here:~$ sleep 1 /1.0s me@here:~$ sleep 73 /1m13.0s - me@here:~$ TIMER_FORMAT='[%d]'; TIMER_PRECISION=2 [0.00s] + me@here:~$ TIMER_FORMAT='[%d]'; TIMER_PRECISION=2 [0.00s] me@here:~$ head -c50 < /dev/urandom | hexdump 0000000 b2 16 20 f0 29 1f 61 2d 8a 29 20 8c 8c 39 5a ab 0000010 21 47 0e f9 ee a4 76 46 71 9e 4f 6b a4 c4 51 cb 0000020 f9 1f 7e b9 6f 2c ae dd cf 40 6d 64 a8 fb d3 db 0000030 09 37 0000032 [0.02s] - -- cgit v1.2.3-70-g09d2 From 6fe2028a1264a79330f16b1dbd6da8f59dc6854f Mon Sep 17 00:00:00 2001 From: Dariusz Luksza Date: Sun, 25 Jan 2015 13:29:42 +0100 Subject: Fix emacs client terminal Fixes #3305 Signed-off-by: Dariusz Luksza --- plugins/emacs/emacs.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plugins') diff --git a/plugins/emacs/emacs.plugin.zsh b/plugins/emacs/emacs.plugin.zsh index c102a5a1e..929aa0616 100644 --- a/plugins/emacs/emacs.plugin.zsh +++ b/plugins/emacs/emacs.plugin.zsh @@ -16,7 +16,7 @@ if "$ZSH/tools/require_tool.sh" emacs 24 2>/dev/null ; then # set EDITOR if not already defined. export EDITOR="${EDITOR:-${EMACS_PLUGIN_LAUNCHER}}" - alias emacs="$EMACS_PLUGIN_LAUNCHER --no-wait" + alias emacs="$EMACS_PLUGIN_LAUNCHER -t" alias e=emacs # open terminal emacsclient alias te="$EMACS_PLUGIN_LAUNCHER -nw" -- cgit v1.2.3-70-g09d2 From 729339c7808f65b95d9fc68f67fed45336ec6eef Mon Sep 17 00:00:00 2001 From: Luiz Guilherme Fonseca Rosa Date: Tue, 2 Oct 2018 21:37:02 -0300 Subject: Update laravel.plugin.zsh Add some laravel aliases --- plugins/laravel/laravel.plugin.zsh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'plugins') diff --git a/plugins/laravel/laravel.plugin.zsh b/plugins/laravel/laravel.plugin.zsh index ed932ee89..7ddfd85ba 100644 --- a/plugins/laravel/laravel.plugin.zsh +++ b/plugins/laravel/laravel.plugin.zsh @@ -1,3 +1,26 @@ #!zsh alias artisan='php artisan' alias bob='php artisan bob::build' + +# Development +alias pas='php artisan serve' + +# Database +alias pam='php artisan migrate' +alias pamf='php artisan migrate:fresh' +alias pamfs='php artisan migrate:fresh --seed' +alias pamr='php artisan migrate:rollback' +alias pads='php artisan db:seed' + +# Makers +alias pamm='php artisan make:model' +alias pamc='php artisan make:controller' +alias pams='php artisan make:seeder' +alias pamt='php artisan make:test' + + +# Clears +alias pacac='php artisan cache:clear' +alias pacoc='php artisan config:clear' +alias pavic='php artisan view:clear' +alias paroc='php artisan route:clear' -- cgit v1.2.3-70-g09d2 From c2113d7cc67e2865a4692918198fba27e8360fe5 Mon Sep 17 00:00:00 2001 From: Luiz Guilherme Fonseca Rosa Date: Tue, 2 Oct 2018 21:44:26 -0300 Subject: Create Laravel plugin README --- plugins/laravel/README.md | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 plugins/laravel/README.md (limited to 'plugins') diff --git a/plugins/laravel/README.md b/plugins/laravel/README.md new file mode 100644 index 000000000..c7ae17f80 --- /dev/null +++ b/plugins/laravel/README.md @@ -0,0 +1,39 @@ +# Laravel + +Enable some cool aliases for Laravel [artisan console](https://laravel.com/docs/5.7/artisan). To use it, add `laravel` to the plugins array of your zshrc file: +``` +plugins=(... laravel) +``` + +| Alias | Description | +|:-:|:-:| +| `artisan` | `php artisan` | +| `pas` | `php artisan serve` | + +## Database + +| Alias | Description | +|:-:|:-:| +| `pam` | `php artisan migrate` | +| `pamf` | `php artisan migrate:fresh` | +| `pamfs` | `php artisan migrate:fresh --seed` | +| `pamr` | `php artisan migrate:rollback` | +| `pads` | `php artisan db:seed` | + +## Makers + +| Alias | Description | +|:-:|:-:| +| `pamm` | `php artisan make:model` | +| `pamc` | `php artisan make:controller` | +| `pams` | `php artisan make:seeder` | +| `pamt` | `php artisan make:test` | + +## Clears + +| Alias | Description | +|:-:|:-:| +| `pacac` | `php artisan cache:clear` | +| `pacoc` | `php artisan config:clear` | +| `pavic` | `php artisan view:clear` | +| `paroc` | `php artisan route:clear` | -- cgit v1.2.3-70-g09d2 From a244d47131e1a638cdb5d0142004200de6872be8 Mon Sep 17 00:00:00 2001 From: Antu Acharjee Date: Thu, 20 Dec 2018 10:25:36 +0600 Subject: Added stackoverflow in /plugins/web-search/-web-search --- plugins/web-search/.web-search.plugin.zsh.swp | Bin 0 -> 12288 bytes plugins/web-search/web-search.plugin.zsh | 2 ++ 2 files changed, 2 insertions(+) create mode 100644 plugins/web-search/.web-search.plugin.zsh.swp (limited to 'plugins') diff --git a/plugins/web-search/.web-search.plugin.zsh.swp b/plugins/web-search/.web-search.plugin.zsh.swp new file mode 100644 index 000000000..b8352f9ec Binary files /dev/null and b/plugins/web-search/.web-search.plugin.zsh.swp differ diff --git a/plugins/web-search/web-search.plugin.zsh b/plugins/web-search/web-search.plugin.zsh index 863384223..b0755f091 100644 --- a/plugins/web-search/web-search.plugin.zsh +++ b/plugins/web-search/web-search.plugin.zsh @@ -17,6 +17,7 @@ function web_search() { ecosia "https://www.ecosia.org/search?q=" goodreads "https://www.goodreads.com/search?q=" qwant "https://www.qwant.com/?q=" + stackoverflow 'https://stackoverflow.com/search?q=" ) # check whether the search engine is supported @@ -51,6 +52,7 @@ alias baidu='web_search baidu' alias ecosia='web_search ecosia' alias goodreads='web_search goodreads' alias qwant='web_search qwant' +alias stack='web_search stackoverflow' #add your own !bang searches here alias wiki='web_search duckduckgo \!w' -- cgit v1.2.3-70-g09d2 From 722af459fd07a5cda6718428f0e44178a963922f Mon Sep 17 00:00:00 2001 From: Antu Acharjee Date: Thu, 20 Dec 2018 10:41:33 +0600 Subject: Added stackoverflow in /plugins/web-search/-web-search --- plugins/web-search/.web-search.plugin.zsh.swp | Bin 12288 -> 0 bytes plugins/web-search/web-search.plugin.zsh | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) delete mode 100644 plugins/web-search/.web-search.plugin.zsh.swp (limited to 'plugins') diff --git a/plugins/web-search/.web-search.plugin.zsh.swp b/plugins/web-search/.web-search.plugin.zsh.swp deleted file mode 100644 index b8352f9ec..000000000 Binary files a/plugins/web-search/.web-search.plugin.zsh.swp and /dev/null differ diff --git a/plugins/web-search/web-search.plugin.zsh b/plugins/web-search/web-search.plugin.zsh index b0755f091..18cc0614a 100644 --- a/plugins/web-search/web-search.plugin.zsh +++ b/plugins/web-search/web-search.plugin.zsh @@ -17,7 +17,7 @@ function web_search() { ecosia "https://www.ecosia.org/search?q=" goodreads "https://www.goodreads.com/search?q=" qwant "https://www.qwant.com/?q=" - stackoverflow 'https://stackoverflow.com/search?q=" + stackoverflow "https://stackoverflow.com/search?q=" ) # check whether the search engine is supported -- cgit v1.2.3-70-g09d2 From 2596aef866e67425d450f8fc006ec0e216e01c93 Mon Sep 17 00:00:00 2001 From: Yusuf Kocaman Date: Mon, 7 Jan 2019 17:24:44 +0300 Subject: added change namespace and rolling restart functions for kubectl --- plugins/kubectl/kubectl.plugin.zsh | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'plugins') diff --git a/plugins/kubectl/kubectl.plugin.zsh b/plugins/kubectl/kubectl.plugin.zsh index 4cfe3f45b..fa74df164 100644 --- a/plugins/kubectl/kubectl.plugin.zsh +++ b/plugins/kubectl/kubectl.plugin.zsh @@ -59,6 +59,7 @@ alias kgns='kubectl get namespaces' alias kens='kubectl edit namespace' alias kdns='kubectl describe namespace' alias kdelns='kubectl delete namespace' +alias kcn='kubectl config set-context $(kubectl config current-context) --namespace' #change namespace # ConfigMap management alias kgcm='kubectl get configmaps' @@ -80,6 +81,10 @@ alias kdd='kubectl describe deployment' alias kdeld='kubectl delete deployment' alias ksd='kubectl scale deployment' alias krsd='kubectl rollout status deployment' +# Recreate all pods in deployment with zero-downtime +kres(){ + kubectl set env $@ REFRESHED_AT=$(date +%Y%m%d%H%M%S) +} # Rollout management. alias kgrs='kubectl get rs' -- cgit v1.2.3-70-g09d2 From d8c71bbce128aaf9f774bf38b6dc573d1a29380d Mon Sep 17 00:00:00 2001 From: Yusuf Kocaman Date: Mon, 7 Jan 2019 17:35:39 +0300 Subject: added details about kcn and kres --- plugins/kubectl/README.md | 2 ++ plugins/kubectl/kubectl.plugin.zsh | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'plugins') diff --git a/plugins/kubectl/README.md b/plugins/kubectl/README.md index a93a9339e..b30f90548 100644 --- a/plugins/kubectl/README.md +++ b/plugins/kubectl/README.md @@ -46,6 +46,7 @@ plugins=(... kubectl) | kdeli | `kubectl delete ingress` | Delete ingress resources matching passed argument | | | | **Namespace management** | | kgns | `kubectl get namespaces` | List the current namespaces in a cluster | +| kcn | `kubectl config set-context ...` | Change current namespace | | kens | `kubectl edit namespace` | Edit namespace resource from the default editor | | kdns | `kubectl describe namespace` | Describe namespace resource in detail | | kdelns | `kubectl delete namespace` | Delete the namespace. WARNING! This deletes everything in the namespace | @@ -67,6 +68,7 @@ plugins=(... kubectl) | kdeld | `kubectl delete deployment` | Delete the deployment | | ksd | `kubectl scale deployment` | Scale a deployment | | krsd | `kubectl rollout status deployment` | Check the rollout status of a deployment | +| kres | `kubectl set env $@ REFRESHED_AT=...` | Recreate all pods in deployment with zero-downtime | | | | **Rollout management** | | kgrs | `kubectl get rs` | To see the ReplicaSet `rs` created by the deployment | | krh | `kubectl rollout history` | Check the revisions of this deployment | diff --git a/plugins/kubectl/kubectl.plugin.zsh b/plugins/kubectl/kubectl.plugin.zsh index fa74df164..d388d6543 100644 --- a/plugins/kubectl/kubectl.plugin.zsh +++ b/plugins/kubectl/kubectl.plugin.zsh @@ -59,7 +59,7 @@ alias kgns='kubectl get namespaces' alias kens='kubectl edit namespace' alias kdns='kubectl describe namespace' alias kdelns='kubectl delete namespace' -alias kcn='kubectl config set-context $(kubectl config current-context) --namespace' #change namespace +alias kcn='kubectl config set-context $(kubectl config current-context) --namespace' # ConfigMap management alias kgcm='kubectl get configmaps' @@ -81,7 +81,6 @@ alias kdd='kubectl describe deployment' alias kdeld='kubectl delete deployment' alias ksd='kubectl scale deployment' alias krsd='kubectl rollout status deployment' -# Recreate all pods in deployment with zero-downtime kres(){ kubectl set env $@ REFRESHED_AT=$(date +%Y%m%d%H%M%S) } -- cgit v1.2.3-70-g09d2 From 7dab4f07e614ad2ebeabb4f3de0bbacb67317540 Mon Sep 17 00:00:00 2001 From: pahakalle Date: Sun, 20 Jan 2019 04:24:52 +0200 Subject: Added brew cask update --- plugins/brew/README.md | 2 ++ plugins/brew/brew.plugin.zsh | 2 ++ 2 files changed, 4 insertions(+) (limited to 'plugins') diff --git a/plugins/brew/README.md b/plugins/brew/README.md index aab55ea39..c129a7652 100644 --- a/plugins/brew/README.md +++ b/plugins/brew/README.md @@ -17,3 +17,5 @@ plugins=(... brew) | bubo | `brew update && brew outdated` | Fetch the newest version of Homebrew and all formulae, then list outdated formulae. | | bubc | `brew upgrade && brew cleanup` | Upgrade outdated, unpinned brews (with existing install options), then removes stale lock files and outdated downloads for formulae and casks, and removes old versions of installed formulae. | | bubu | `bubo && bubc` | Updates Homebrew, lists outdated formulae, upgrades oudated and unpinned formulae, and removes stale and outdated downloads and versions. | +| bcubo | `brew update && brew cask outdated` | Fetch the newest version of Homebrew and all formulae, then list outdated casks. | +| bcubc | `brew cask reinstall $(brew cask outdated) && brew cleanup` | Updates outdated casks, then runs cleanup. | \ No newline at end of file diff --git a/plugins/brew/brew.plugin.zsh b/plugins/brew/brew.plugin.zsh index 60b81f8ec..cfbaa3480 100644 --- a/plugins/brew/brew.plugin.zsh +++ b/plugins/brew/brew.plugin.zsh @@ -4,6 +4,8 @@ alias brewsp='brew list --pinned' alias bubo='brew update && brew outdated' alias bubc='brew upgrade && brew cleanup' alias bubu='bubo && bubc' +alias bcubo='brew update && brew cask outdated' +alias bcubc='brew cask reinstall $(brew cask outdated) && brew cleanup' if command mkdir "$ZSH_CACHE_DIR/.brew-completion-message" 2>/dev/null; then print -P '%F{yellow}'Oh My Zsh brew plugin: -- cgit v1.2.3-70-g09d2 From fcf1fe72c0057b5eccecd7ae9bfc2fe199cc9b3d Mon Sep 17 00:00:00 2001 From: "Z.Shang" Date: Tue, 22 Jan 2019 04:49:21 +1100 Subject: init ros plugin --- plugins/ros/README.mkd | 10 ++++++++ plugins/ros/_ros | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 74 insertions(+) create mode 100644 plugins/ros/README.mkd create mode 100644 plugins/ros/_ros (limited to 'plugins') diff --git a/plugins/ros/README.mkd b/plugins/ros/README.mkd new file mode 100644 index 000000000..83573e499 --- /dev/null +++ b/plugins/ros/README.mkd @@ -0,0 +1,10 @@ +# Roswell Plugin + +This plugin adds completions and aliases for [Roswell](https://github.com/roswell/roswell/). + +To use it, add `ros` to the plugins array in your zshrc file: + +```zsh +plugins=(... ros) +``` + diff --git a/plugins/ros/_ros b/plugins/ros/_ros new file mode 100644 index 000000000..6a04d3c8f --- /dev/null +++ b/plugins/ros/_ros @@ -0,0 +1,64 @@ +#compdef ros +#autoload + +# roswell zsh completion, based on gem completion + +local -a _1st_arguments +_1st_arguments=( +'run: Run repl' +'install:Install a given implementation or a system for roswell environment' +'update:Update installed systems.' +'build:Make executable from script.' +'use:Change default implementation.' +'init:a new ros script, optionally based on a template.' +'fmt:Indent lisp source.' +'list:Information' +'template:[WIP] Manage templates' +'delete:Delete installed implementations' +'config:Get and set options' +'version:Show the roswell version information' +"help:Use \"ros help [command]\" for more information about a command."$'\n\t\t'"Use \"ros help [topic]\" for more information about the topic." +) + +#local expl + +_arguments \ + '(--version)'--version'[Print version information and quit]' \ + '(-w --wrap)'{-w,--wrap}'[\[CODE\] Run roswell with a shell wrapper CODE]' \ + '(-m --image)'{-m,--image}'[\[IMAGE\] continue from Lisp image IMAGE]' \ + '(-M --module)'{-M,--module}'[\[NAME\] Execute ros script found in ROSWELLPATH. (pythons -m)]' \ + '(-L --lisp)'{-L,--lisp}'[\[NAME\] Run roswell with a lisp impl NAME\[/VERSION\].]' \ + '(-l --load)'{-l,--load}'[\[FILE\] load lisp FILE while building]' \ + '(-S --source-registry)'{-S,--source-registry}'[\[X\] override source registry of asdf systems]' \ + '(-s --system --load-system)'{-s,--system,--load-system}'[\[SYSTEM\] load asdf SYSTEM while building]' \ + '(-p --package)'{-p,--package}'[\[PACKAGE\] change current package to \[PACKAGE\]]' \ + '(-sp --system-package)'{-sp,--system-package}'[\[SP\] combination of -s \[SP\] and -p \[SP\]]' \ + '(-e --eval)'{-e,--eval}'[\[FORM\] evaluate \[FORM\] while building]' \ + '--require'--require'[\[MODULE\] require \[MODULE\] while building]' \ + '(-q --quit)'{-q,--quit}'[quit lisp here]' \ + '(-r --restart)'{-r,--restart}'[\[FUNC\] restart from build by calling (\[FUNC\])]' \ + '(-E --entry)'{-E,--entry}'[\[FUNC\] restart from build by calling (\[FUNC\] argv)]' \ + '(-i --init)'{-i,--init}'[\[FORM\] evaluate \[FORM\] after restart]' \ + '(-ip --print)'{-ip,--print}'[\[FORM\] evaluate and princ \[FORM\] after restart]' \ + '(-iw --write)'{-iw,--write}'[\[FORM\] evaluate and write \[FORM\] after restart]' \ + '(-F --final)'{-F,--final}'[\[FORM\] evaluate \[FORM\] before dumping IMAGE]' \ + '(\+R --no-rc)'{\+R,--no-rc}'[skip /etc/rosrc, ~/.roswell/init.lisp]' \ + '(-A --asdf)'{-A,--asdf}'[use new asdf]' \ + '(\+Q --no-quicklisp)'{\+Q,--no-quicklisp}'[do not use quicklisp]' \ + '(-v --verbose)'{-v,--verbose}'[be quite noisy while building]' \ + '--quiet'--quiet'[be quite quiet while building default]' \ + '--test'--test'[for test purpose]' \ + '*:: :->subcmds' && return 0 + + +if (( CURRENT == 1 )); then + _describe -t commands "ros subcommand" _1st_arguments + return +fi + +# _files +case "$words[1]" in + -l|--load) + _files + ;; +esac -- cgit v1.2.3-70-g09d2 From 12c516822c7017355e264540b236405e1ab49a84 Mon Sep 17 00:00:00 2001 From: Jesse Farinacci Date: Tue, 22 Jan 2019 10:09:07 -0500 Subject: add brew install path to search recent `brew install jenv` installs to `/usr/local/bin/jenv`, auto-discover it for recent brew installs to avoid secondary, slower search --- plugins/jenv/jenv.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plugins') diff --git a/plugins/jenv/jenv.plugin.zsh b/plugins/jenv/jenv.plugin.zsh index 14c586be9..2eda8037b 100644 --- a/plugins/jenv/jenv.plugin.zsh +++ b/plugins/jenv/jenv.plugin.zsh @@ -1,4 +1,4 @@ -jenvdirs=("$HOME/.jenv" "/usr/local/jenv" "/opt/jenv") +jenvdirs=("$HOME/.jenv" "/usr/local" "/usr/local/jenv" "/opt/jenv") FOUND_JENV=0 for jenvdir in $jenvdirs; do -- cgit v1.2.3-70-g09d2 From e634730e35450b408efa6acc9273d3c1eff12d8c Mon Sep 17 00:00:00 2001 From: genevera Date: Tue, 5 Feb 2019 05:20:25 -0500 Subject: update spotify to newest version --- plugins/osx/spotify | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'plugins') diff --git a/plugins/osx/spotify b/plugins/osx/spotify index 2ab98d3a0..b4215dbe7 100644 --- a/plugins/osx/spotify +++ b/plugins/osx/spotify @@ -1,7 +1,7 @@ #!/usr/bin/env bash function spotify() { -# Copyright (c) 2012--2017 Harish Narayanan +# Copyright (c) 2012--2018 Harish Narayanan # # Contains numerous helpful contributions from Jorge Colindres, Thomas # Pritchard, iLan Epstein, Gabriele Bonetti, Sean Heller, Eric Martin @@ -134,8 +134,13 @@ showStatus () { if [ $# = 0 ]; then showHelp; else + if [ ! -d /Applications/Spotify.app ] && [ ! -d $HOME/Applications/Spotify.app ]; then + echo "The Spotify application must be installed." + exit 1 + fi + if [ $(osascript -e 'application "Spotify" is running') = "false" ]; then - osascript -e 'tell application "Spotify" to activate' + osascript -e 'tell application "Spotify" to activate' || exit 1 sleep 2 fi fi @@ -160,7 +165,7 @@ while [ $# -gt 0 ]; do showAPIHelp; exit 1; fi - SHPOTIFY_CREDENTIALS=$(printf "${CLIENT_ID}:${CLIENT_SECRET}" | base64 | tr -d "\n"); + SHPOTIFY_CREDENTIALS=$(printf "${CLIENT_ID}:${CLIENT_SECRET}" | base64 | tr -d "\n"|tr -d '\r'); SPOTIFY_PLAY_URI=""; getAccessToken() { -- cgit v1.2.3-70-g09d2 From 052493b1ba71fe7e13554e57571fe4c793d53c3c Mon Sep 17 00:00:00 2001 From: Marc Cornellà Date: Wed, 6 Feb 2019 11:55:38 +0100 Subject: z: refresh $RANDOM's value outside subshell This change references `$RANDOM` outside the subshell to refresh it for the next subshell invocation. Otherwise, subsequent runs of the function get the same value and, if run simultaneously, they may clobber each others' temp .z files. This is due to how zsh distributes RANDOM values when running inside a subshell: subshells that reference RANDOM will result in identical pseudo-random values unless the value of RANDOM is referenced or seeded in the parent shell in between subshell invocations See: http://zsh.sourceforge.net/Doc/Release/Parameters.html#index-RANDOM --- plugins/z/z.sh | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'plugins') diff --git a/plugins/z/z.sh b/plugins/z/z.sh index 4fc75dc6a..5fe6d5266 100644 --- a/plugins/z/z.sh +++ b/plugins/z/z.sh @@ -222,10 +222,16 @@ if type compctl >/dev/null 2>&1; then if [ "$_Z_NO_RESOLVE_SYMLINKS" ]; then _z_precmd() { (_z --add "${PWD:a}" &) + # Reference $RANDOM to refresh its value inside the subshell + # Otherwise, multiple runs get the same value + : $RANDOM } else _z_precmd() { (_z --add "${PWD:A}" &) + # Reference $RANDOM to refresh its value inside the subshell + # Otherwise, multiple runs get the same value + : $RANDOM } fi [[ -n "${precmd_functions[(r)_z_precmd]}" ]] || { -- cgit v1.2.3-70-g09d2 From 86ea319536a8012b9e8f508d3d257029014bdafe Mon Sep 17 00:00:00 2001 From: eric-christian <298704+eric-christian@users.noreply.github.com> Date: Fri, 8 Feb 2019 15:14:09 +0100 Subject: asdf: fix homebrew installation path (#7582) * The check for the asdf installation directory is more precise: The existence of the directory `$HOME/.asdf` does not mean that it is the installation directory of `asdf`. It will also be created after installing at least one asdf plugin. * Completions, while installed with homebrew, are now expected on an alternative location. --- plugins/asdf/asdf.plugin.zsh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'plugins') diff --git a/plugins/asdf/asdf.plugin.zsh b/plugins/asdf/asdf.plugin.zsh index 75395c718..38b225538 100644 --- a/plugins/asdf/asdf.plugin.zsh +++ b/plugins/asdf/asdf.plugin.zsh @@ -1,9 +1,11 @@ # Find where asdf should be installed ASDF_DIR="${ASDF_DIR:-$HOME/.asdf}" +ASDF_COMPLETIONS="$ASDF_DIR/completions" # If not found, check for Homebrew package -if [[ ! -d $ASDF_DIR ]] && (( $+commands[brew] )); then +if [[ ! -f "$ASDF_DIR/asdf.sh" ]] && (( $+commands[brew] )); then ASDF_DIR="$(brew --prefix asdf)" + ASDF_COMPLETIONS="$ASDF_DIR/etc/bash_completion.d" fi # Load command @@ -11,7 +13,7 @@ if [[ -f "$ASDF_DIR/asdf.sh" ]]; then . "$ASDF_DIR/asdf.sh" # Load completions - if [[ -f "$ASDF_DIR/completions/asdf.bash" ]]; then - . "$ASDF_DIR/completions/asdf.bash" + if [[ -f "$ASDF_COMPLETIONS/asdf.bash" ]]; then + . "$ASDF_COMPLETIONS/asdf.bash" fi fi -- cgit v1.2.3-70-g09d2