1
0
mirror of https://github.com/ohmyzsh/ohmyzsh.git synced 2026-01-14 22:47:45 +08:00

Merge branch 'ohmyzsh:master' into pdfcreating

This commit is contained in:
Hex-Tron 2024-09-28 08:25:27 +05:30 committed by GitHub
commit 90814f3597
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 32 additions and 1 deletions

11
plugins/chezmoi/README.md Normal file
View File

@ -0,0 +1,11 @@
# chezmoi Plugin
## Introduction
This `chezmoi` plugin sets up completion for [chezmoi](https://chezmoi.io).
To use it, add `chezmoi` to the plugins array of your zshrc file:
```bash
plugins=(... chezmoi)
```

View File

@ -0,0 +1,14 @@
# COMPLETION FUNCTION
if (( ! $+commands[chezmoi] )); then
return
fi
# If the completion file doesn't exist yet, we need to autoload it and
# bind it to `chezmoi`. Otherwise, compinit will have already done that.
if [[ ! -f "$ZSH_CACHE_DIR/completions/_chezmoi" ]]; then
typeset -g -A _comps
autoload -Uz _chezmoi
_comps[chezmoi]=_chezmoi
fi
chezmoi completion zsh >| "$ZSH_CACHE_DIR/completions/_chezmoi" &|

View File

@ -100,7 +100,11 @@ function _add_identities() {
if zstyle -t :omz:plugins:ssh-agent agent-forwarding \
&& [[ -n "$SSH_AUTH_SOCK" ]]; then
if [[ ! -L "$SSH_AUTH_SOCK" ]]; then
ln -sf "$SSH_AUTH_SOCK" /tmp/ssh-agent-$USERNAME-screen
if [[ -n "$TERMUX_VERSION" ]]; then
ln -sf "$SSH_AUTH_SOCK" "$PREFIX"/tmp/ssh-agent-$USERNAME-screen
else
ln -sf "$SSH_AUTH_SOCK" /tmp/ssh-agent-$USERNAME-screen
fi
fi
else
_start_agent

View File

@ -13,6 +13,7 @@ plugins=(... systemadmin)
| Alias | Command | Description |
|---------|----------------------------------------------------------------------------|--------------------------------------------------------------------|
| ping | `ping -c 5` | Sends only 5 ICMP Messages |
| ping6 | `ping6 -c 5` | Sends only 5 ICMPv6 Messages |
| clr | `clear; echo Currently logged in on $TTY, as $USERNAME in directory $PWD.` | Clears the screen and prints the current user, TTY, and directory |
| path | `print -l $path` | Displays PATH with each entry on a separate line |
| mkdir | `mkdir -pv` | Automatically create parent directories and display verbose output |

View File

@ -21,6 +21,7 @@ function retlog() {
}
alias ping='ping -c 5'
alias ping6='ping6 -c 5'
alias clr='clear; echo Currently logged in on $TTY, as $USERNAME in directory $PWD.'
alias path='print -l $path'
alias mkdir='mkdir -pv'