From 0ab87c26c17171ae6162ff379a0c704fa57dff2e Mon Sep 17 00:00:00 2001 From: Vlad Korolev Date: Mon, 8 Mar 2021 01:46:42 -0800 Subject: fix(terraform): use faster method to get workspace (#9709) Also add tf_prompt_info to the list of prompt functions so theme writers are aware of it --- plugins/terraform/terraform.plugin.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'plugins') diff --git a/plugins/terraform/terraform.plugin.zsh b/plugins/terraform/terraform.plugin.zsh index 2c42d394d..997241c9a 100644 --- a/plugins/terraform/terraform.plugin.zsh +++ b/plugins/terraform/terraform.plugin.zsh @@ -2,8 +2,8 @@ function tf_prompt_info() { # dont show 'default' workspace in home dir [[ "$PWD" == ~ ]] && return # check if in terraform dir - if [ -d .terraform ]; then - workspace=$(terraform workspace show 2> /dev/null) || return + if [[ -d .terraform && -r .terraform/environment ]]; then + workspace=$(cat .terraform/environment) || return echo "[${workspace}]" fi } -- cgit v1.2.3-70-g09d2 From 040aadf7c460112386d23786d8d3f5d2dcfbfeb4 Mon Sep 17 00:00:00 2001 From: John Delgado Date: Mon, 15 Mar 2021 20:06:01 +0100 Subject: feat(git): add `grbo` alias for `git rebase --onto` (#8088) --- plugins/git/README.md | 1 + plugins/git/git.plugin.zsh | 1 + 2 files changed, 2 insertions(+) (limited to 'plugins') diff --git a/plugins/git/README.md b/plugins/git/README.md index 029386267..6ad19543e 100644 --- a/plugins/git/README.md +++ b/plugins/git/README.md @@ -124,6 +124,7 @@ plugins=(... git) | grbd | git rebase develop | | grbi | git rebase -i | | grbm | git rebase $(git_main_branch) | +| grbo | git rebase --onto | | grbs | git rebase --skip | | grev | git revert | | grh | git reset | diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh index 2f97dbc92..8167980fa 100644 --- a/plugins/git/git.plugin.zsh +++ b/plugins/git/git.plugin.zsh @@ -224,6 +224,7 @@ alias grbc='git rebase --continue' alias grbd='git rebase develop' alias grbi='git rebase -i' alias grbm='git rebase $(git_main_branch)' +alias grbo='git rebase --onto' alias grbs='git rebase --skip' alias grev='git revert' alias grh='git reset' -- cgit v1.2.3-70-g09d2 From 9d556cd5458aba76dc4ab09bc53f53f2a1893ce9 Mon Sep 17 00:00:00 2001 From: Piotr Rogoża Date: Mon, 15 Mar 2021 22:27:00 +0100 Subject: fix(emotty): fix `bad assignment` error (#9714) --- plugins/emotty/emotty.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plugins') diff --git a/plugins/emotty/emotty.plugin.zsh b/plugins/emotty/emotty.plugin.zsh index e288b5cfb..4511275d6 100644 --- a/plugins/emotty/emotty.plugin.zsh +++ b/plugins/emotty/emotty.plugin.zsh @@ -29,7 +29,7 @@ function emotty() { # Parse tty number via prompt expansion. %l equals: # - N if tty = /dev/ttyN # - pts/N if tty = /dev/pts/N - local tty = ${${(%):-%l}##pts/} + local tty=${${(%):-%l}##pts/} # Normalize it to an emotty set index (( tty = (tty % ${#${=emotty}}) + 1 )) -- cgit v1.2.3-70-g09d2 From 90bdb8a1561b8eef759c8e46a31845265f8cb9b9 Mon Sep 17 00:00:00 2001 From: Dario Vladović Date: Mon, 15 Mar 2021 22:34:47 +0100 Subject: feat(fzf): add support for Termux package (#9718) --- plugins/fzf/fzf.plugin.zsh | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) (limited to 'plugins') diff --git a/plugins/fzf/fzf.plugin.zsh b/plugins/fzf/fzf.plugin.zsh index 524089983..69ec1d411 100644 --- a/plugins/fzf/fzf.plugin.zsh +++ b/plugins/fzf/fzf.plugin.zsh @@ -64,11 +64,21 @@ function setup_using_debian_package() { # NOTE: There is no need to configure PATH for debian package, all binaries # are installed to /usr/bin by default - # Determine completion file path: first bullseye/sid, then buster/stretch - local completions="/usr/share/doc/fzf/examples/completion.zsh" - [[ -f "$completions" ]] || completions="/usr/share/zsh/vendor-completions/_fzf" - - local key_bindings="/usr/share/doc/fzf/examples/key-bindings.zsh" + local completions key_bindings + + case $PREFIX in + *com.termux*) + # Support Termux package + completions="${PREFIX}/share/fzf/completion.zsh" + key_bindings="${PREFIX}/share/fzf/key-bindings.zsh" + ;; + *) + # Determine completion file path: first bullseye/sid, then buster/stretch + completions="/usr/share/doc/fzf/examples/completion.zsh" + [[ -f "$completions" ]] || completions="/usr/share/zsh/vendor-completions/_fzf" + key_bindings="/usr/share/doc/fzf/examples/key-bindings.zsh" + ;; + esac # Auto-completion if [[ -o interactive && "$DISABLE_FZF_AUTO_COMPLETION" != "true" ]]; then -- cgit v1.2.3-70-g09d2 From 0e232d48537bd6f2c3ccbb4c96810fddffc7cfae Mon Sep 17 00:00:00 2001 From: Will Boyce Date: Mon, 15 Mar 2021 21:51:33 +0000 Subject: feat(ssh-agent): add `ssh-add-args` setting (#7908) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * ssh-agent: add `:omz:plugins:ssh-agent ssh_add_args` option * Clean up and document extra setting * Document valid ssh-add arguments Co-authored-by: Marc Cornellà --- plugins/ssh-agent/README.md | 24 +++++++++++++++++++++++- plugins/ssh-agent/ssh-agent.plugin.zsh | 4 +++- 2 files changed, 26 insertions(+), 2 deletions(-) (limited to 'plugins') diff --git a/plugins/ssh-agent/README.md b/plugins/ssh-agent/README.md index 0b96d9bb5..8765a9c7e 100644 --- a/plugins/ssh-agent/README.md +++ b/plugins/ssh-agent/README.md @@ -9,7 +9,7 @@ To enable it, add `ssh-agent` to your plugins: plugins=(... ssh-agent) ``` -## Instructions +## Settings **IMPORTANT: put these settings _before_ the line that sources oh-my-zsh** @@ -19,12 +19,16 @@ To enable **agent forwarding support** add the following to your zshrc file: zstyle :omz:plugins:ssh-agent agent-forwarding on ``` +---- + To **load multiple identities** use the `identities` style, For example: ```zsh zstyle :omz:plugins:ssh-agent identities id_rsa id_rsa2 id_github ``` +---- + To **set the maximum lifetime of the identities**, use the `lifetime` style. The lifetime may be specified in seconds or as described in sshd_config(5) (see _TIME FORMATS_). If left unspecified, the default lifetime is forever. @@ -33,6 +37,24 @@ The lifetime may be specified in seconds or as described in sshd_config(5) zstyle :omz:plugins:ssh-agent lifetime 4h ``` +---- + +To **pass arguments to the `ssh-add` command** that adds the identities on startup, +use the `ssh-add-args` setting. You can pass multiple arguments separated by spaces: + +```zsh +zstyle :omz:plugins:ssh-agent ssh-add-args -K -c -a /run/user/1000/ssh-auth +``` + +These will then be passed the the `ssh-add` call as if written directly. The example +above will turn into: + +```zsh +ssh-add -K -c -a /run/user/1000/ssh-auth +``` + +For valid `ssh-add` arguments run `ssh-add --help` or `man ssh-add`. + ## Credits Based on code from Joseph M. Reagle: https://www.cygwin.com/ml/cygwin/2001-06/msg00537.html diff --git a/plugins/ssh-agent/ssh-agent.plugin.zsh b/plugins/ssh-agent/ssh-agent.plugin.zsh index 6ab041c21..430647135 100644 --- a/plugins/ssh-agent/ssh-agent.plugin.zsh +++ b/plugins/ssh-agent/ssh-agent.plugin.zsh @@ -48,7 +48,9 @@ function _add_identities() { fi done - [[ -n "$not_loaded" ]] && ssh-add ${^not_loaded} + local args + zstyle -a :omz:plugins:ssh-agent ssh-add-args args + [[ -n "$not_loaded" ]] && ssh-add "${args[@]}" ${^not_loaded} } # Get the filename to store/lookup the environment from -- cgit v1.2.3-70-g09d2 From e5d206c8c8c28eba856b590860294ebe6baed35e Mon Sep 17 00:00:00 2001 From: wahjava Date: Tue, 16 Mar 2021 03:57:57 +0530 Subject: fix(fossil): PROMPT and RPROMPT are no longer exported (#9655) Fixes #9654 --- plugins/fossil/fossil.plugin.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'plugins') diff --git a/plugins/fossil/fossil.plugin.zsh b/plugins/fossil/fossil.plugin.zsh index 1ae166e62..25a8d121d 100644 --- a/plugins/fossil/fossil.plugin.zsh +++ b/plugins/fossil/fossil.plugin.zsh @@ -73,9 +73,9 @@ function _fossil_prompt () { local is_prompt=`echo $PROMPT | grep git` if [ "$is_prompt" = "" ]; then - export RPROMPT="$_rprompt"'$(fossil_prompt_info)' + RPROMPT="$_rprompt"'$(fossil_prompt_info)' else - export PROMPT="$_prompt"'$(fossil_prompt_info) ' + PROMPT="$_prompt"'$(fossil_prompt_info) ' fi _FOSSIL_PROMPT="1" -- cgit v1.2.3-70-g09d2 From 3f34ce4da401a18dc36c95f0c41280b544b02b6a Mon Sep 17 00:00:00 2001 From: CrispyConductor Date: Mon, 15 Mar 2021 18:32:49 -0400 Subject: fix(vi-mode): fix keymap indicator on zle-line-finish (#9620) * Update VI_KEYMAP on zle-line-finish. Fixes next prompt draw. * Also fix vi-mode prompt redraw in case previous prompt was canceled * Do not redraw fix prompt if VI_MODE_RESET_PROMPT_ON_MODE_CHANGE is unset * Use a local variable instead of global in function --- plugins/vi-mode/vi-mode.plugin.zsh | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'plugins') diff --git a/plugins/vi-mode/vi-mode.plugin.zsh b/plugins/vi-mode/vi-mode.plugin.zsh index 7f14961ad..dd4afdd8b 100644 --- a/plugins/vi-mode/vi-mode.plugin.zsh +++ b/plugins/vi-mode/vi-mode.plugin.zsh @@ -50,13 +50,17 @@ zle -N zle-keymap-select # These "echoti" statements were originally set in lib/key-bindings.zsh # Not sure the best way to extend without overriding. function zle-line-init() { + local prev_vi_keymap + prev_vi_keymap="${VI_KEYMAP:-}" typeset -g VI_KEYMAP=main + [[ "$prev_vi_keymap" != 'main' ]] && [[ "${VI_MODE_RESET_PROMPT_ON_MODE_CHANGE:-}" = true ]] && zle reset-prompt (( ! ${+terminfo[smkx]} )) || echoti smkx _vi-mode-set-cursor-shape-for-keymap "${VI_KEYMAP}" } zle -N zle-line-init function zle-line-finish() { + typeset -g VI_KEYMAP=main (( ! ${+terminfo[rmkx]} )) || echoti rmkx _vi-mode-set-cursor-shape-for-keymap default } -- cgit v1.2.3-70-g09d2