summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorTuowen Zhao <ztuowen@gmail.com>2021-03-16 14:46:40 -0600
committerTuowen Zhao <ztuowen@gmail.com>2021-03-16 14:46:40 -0600
commit0a67be1024b1e54b6af59f01b01ceace9fdf7bb2 (patch)
tree2e989a1c283cc942312222d1afecd28640c5315b /plugins
parent0f2bface6494ae546ea83cbf45b65a18dbc0c4fb (diff)
parent95a06f3927a286db257dc99791b02caba757fe33 (diff)
downloadzsh-0a67be1024b1e54b6af59f01b01ceace9fdf7bb2.tar.gz
zsh-0a67be1024b1e54b6af59f01b01ceace9fdf7bb2.tar.bz2
zsh-0a67be1024b1e54b6af59f01b01ceace9fdf7bb2.zip
Merge remote-tracking branch 'origin/master'
Diffstat (limited to 'plugins')
-rw-r--r--plugins/emotty/emotty.plugin.zsh2
-rw-r--r--plugins/fossil/fossil.plugin.zsh4
-rw-r--r--plugins/fzf/fzf.plugin.zsh20
-rw-r--r--plugins/git/README.md1
-rw-r--r--plugins/git/git.plugin.zsh1
-rw-r--r--plugins/ssh-agent/README.md24
-rw-r--r--plugins/ssh-agent/ssh-agent.plugin.zsh4
-rw-r--r--plugins/terraform/terraform.plugin.zsh4
-rw-r--r--plugins/vi-mode/vi-mode.plugin.zsh4
9 files changed, 52 insertions, 12 deletions
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 ))
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"
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
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'
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 <identities>
+```
+
+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
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
}
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
}