mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-03-04 13:25:05 +08:00
Compare commits
18 Commits
9df4ea095f
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bf2948322b | ||
|
|
25d4d753bf | ||
|
|
3fd2331ae8 | ||
|
|
6bb9718dd2 | ||
|
|
5c4f27b716 | ||
|
|
400591e71c | ||
|
|
536515d186 | ||
|
|
2117ee5cf7 | ||
|
|
7f8d6b1fca | ||
|
|
52d93f18d6 | ||
|
|
44f2a128aa | ||
|
|
45dd7d006a | ||
|
|
993afc8267 | ||
|
|
a8aca3fba5 | ||
|
|
cdd31a7ab3 | ||
|
|
88659ed193 | ||
|
|
41c5b9677a | ||
|
|
116be8badd |
2
.github/dependencies.yml
vendored
2
.github/dependencies.yml
vendored
@@ -30,7 +30,7 @@ dependencies:
|
||||
plugins/kube-ps1:
|
||||
repo: jonmosco/kube-ps1
|
||||
branch: master
|
||||
version: 0b0e6daf4197ecabb1ae4f2d46fb148a8e1e73e5
|
||||
version: 9b41c091d5dd4a99e58cf58b5d98a4847937b1bb
|
||||
precopy: |
|
||||
set -e
|
||||
find . ! -name kube-ps1.sh ! -name LICENSE ! -name README.md -delete
|
||||
|
||||
2
.github/workflows/dependencies.yml
vendored
2
.github/workflows/dependencies.yml
vendored
@@ -13,7 +13,7 @@ jobs:
|
||||
contents: write # this is needed to push commits and branches
|
||||
steps:
|
||||
- name: Harden the runner (Audit all outbound calls)
|
||||
uses: step-security/harden-runner@e3f713f2d8f53843e71c69a996d56f51aa9adfb9 # v2.14.1
|
||||
uses: step-security/harden-runner@a90bcbc6539c36a85cdfeb73f7e2f433735f215b # v2.15.0
|
||||
with:
|
||||
egress-policy: audit
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
certifi==2026.1.4
|
||||
certifi==2026.2.25
|
||||
charset-normalizer==3.4.4
|
||||
idna==3.11
|
||||
PyYAML==6.0.3
|
||||
|
||||
4
.github/workflows/installer.yml
vendored
4
.github/workflows/installer.yml
vendored
@@ -26,7 +26,7 @@ jobs:
|
||||
- macos-latest
|
||||
steps:
|
||||
- name: Harden the runner (Audit all outbound calls)
|
||||
uses: step-security/harden-runner@e3f713f2d8f53843e71c69a996d56f51aa9adfb9 # v2.14.1
|
||||
uses: step-security/harden-runner@a90bcbc6539c36a85cdfeb73f7e2f433735f215b # v2.15.0
|
||||
with:
|
||||
egress-policy: audit
|
||||
|
||||
@@ -47,7 +47,7 @@ jobs:
|
||||
- test
|
||||
steps:
|
||||
- name: Harden the runner (Audit all outbound calls)
|
||||
uses: step-security/harden-runner@e3f713f2d8f53843e71c69a996d56f51aa9adfb9 # v2.14.1
|
||||
uses: step-security/harden-runner@a90bcbc6539c36a85cdfeb73f7e2f433735f215b # v2.15.0
|
||||
with:
|
||||
egress-policy: audit
|
||||
|
||||
|
||||
2
.github/workflows/main.yml
vendored
2
.github/workflows/main.yml
vendored
@@ -24,7 +24,7 @@ jobs:
|
||||
if: github.repository == 'ohmyzsh/ohmyzsh'
|
||||
steps:
|
||||
- name: Harden the runner (Audit all outbound calls)
|
||||
uses: step-security/harden-runner@e3f713f2d8f53843e71c69a996d56f51aa9adfb9 # v2.14.1
|
||||
uses: step-security/harden-runner@a90bcbc6539c36a85cdfeb73f7e2f433735f215b # v2.15.0
|
||||
with:
|
||||
egress-policy: audit
|
||||
|
||||
|
||||
2
.github/workflows/project.yml
vendored
2
.github/workflows/project.yml
vendored
@@ -17,7 +17,7 @@ jobs:
|
||||
if: github.repository == 'ohmyzsh/ohmyzsh'
|
||||
steps:
|
||||
- name: Harden the runner (Audit all outbound calls)
|
||||
uses: step-security/harden-runner@e3f713f2d8f53843e71c69a996d56f51aa9adfb9 # v2.14.1
|
||||
uses: step-security/harden-runner@a90bcbc6539c36a85cdfeb73f7e2f433735f215b # v2.15.0
|
||||
with:
|
||||
egress-policy: audit
|
||||
- name: Authenticate as @ohmyzsh
|
||||
|
||||
6
.github/workflows/scorecard.yml
vendored
6
.github/workflows/scorecard.yml
vendored
@@ -36,7 +36,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Harden the runner (Audit all outbound calls)
|
||||
uses: step-security/harden-runner@e3f713f2d8f53843e71c69a996d56f51aa9adfb9 # v2.14.1
|
||||
uses: step-security/harden-runner@a90bcbc6539c36a85cdfeb73f7e2f433735f215b # v2.15.0
|
||||
with:
|
||||
egress-policy: audit
|
||||
|
||||
@@ -53,13 +53,13 @@ jobs:
|
||||
publish_results: true
|
||||
|
||||
- name: "Upload artifact"
|
||||
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
|
||||
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
|
||||
with:
|
||||
name: SARIF file
|
||||
path: results.sarif
|
||||
retention-days: 5
|
||||
|
||||
- name: "Upload to code-scanning"
|
||||
uses: github/codeql-action/upload-sarif@b20883b0cd1f46c72ae0ba6d1090936928f9fa30 # v4.32.0
|
||||
uses: github/codeql-action/upload-sarif@89a39a4e59826350b863aa6b6252a07ad50cf83e # v4.32.4
|
||||
with:
|
||||
sarif_file: results.sarif
|
||||
|
||||
@@ -40,9 +40,9 @@ if [[ -z "$LS_COLORS" ]]; then
|
||||
fi
|
||||
|
||||
function test-ls-args {
|
||||
local cmd="$1" # ls, gls, colorls, ...
|
||||
local args="${@[2,-1]}" # arguments except the first one
|
||||
command "$cmd" "$args" /dev/null &>/dev/null
|
||||
# Usage: test-ls-args cmd args...
|
||||
# e.g. test-ls-args gls --color
|
||||
command "$@" /dev/null &>/dev/null
|
||||
}
|
||||
|
||||
# Find the option for using colors in ls, depending on the version
|
||||
|
||||
@@ -43,7 +43,7 @@ function colored() {
|
||||
environment+=( PATH="${__colored_man_pages_dir}:$PATH" )
|
||||
fi
|
||||
|
||||
command env $environment "$@"
|
||||
command env "${environment[@]}" "$@"
|
||||
}
|
||||
|
||||
# Colorize man and dman/debman (from debian-goodies)
|
||||
|
||||
@@ -6,14 +6,22 @@ command -v dnf5 > /dev/null && dnfprog=dnf5
|
||||
|
||||
alias dnfl="${dnfprog} list" # List packages
|
||||
alias dnfli="${dnfprog} list installed" # List installed packages
|
||||
alias dnfgl="${dnfprog} grouplist" # List package groups
|
||||
alias dnfmc="${dnfprog} makecache" # Generate metadata cache
|
||||
alias dnfp="${dnfprog} info" # Show package information
|
||||
alias dnfs="${dnfprog} search" # Search package
|
||||
|
||||
alias dnfu="sudo ${dnfprog} upgrade" # Upgrade package
|
||||
alias dnfi="sudo ${dnfprog} install" # Install package
|
||||
alias dnfgi="sudo ${dnfprog} groupinstall" # Install package group
|
||||
alias dnfr="sudo ${dnfprog} remove" # Remove package
|
||||
alias dnfgr="sudo ${dnfprog} groupremove" # Remove package group
|
||||
alias dnfc="sudo ${dnfprog} clean all" # Clean cache
|
||||
|
||||
# Conditional aliases based on dnfprog value
|
||||
if [[ "${dnfprog}" == "dnf5" ]]; then
|
||||
alias dnfgl="${dnfprog} group list" # List package groups (dnf5)
|
||||
alias dnfgi="sudo ${dnfprog} group install" # Install package group (dnf5)
|
||||
alias dnfgr="sudo ${dnfprog} group remove" # Remove package group (dnf5)
|
||||
else
|
||||
alias dnfgl="${dnfprog} grouplist" # List package groups (dnf)
|
||||
alias dnfgi="sudo ${dnfprog} groupinstall" # Install package group (dnf)
|
||||
alias dnfgr="sudo ${dnfprog} groupremove" # Remove package group (dnf)
|
||||
fi
|
||||
|
||||
@@ -78,6 +78,14 @@ change.
|
||||
NOTE: if a directory is found in both the allowed and disallowed lists, the disallowed list
|
||||
takes preference, _i.e._ the .env file will never be sourced.
|
||||
|
||||
## Named Pipe (FIFO) Support
|
||||
|
||||
The plugin supports `.env` files provided as UNIX named pipes (FIFOs) in addition to regular files.
|
||||
This is useful when secrets managers like [1Password Environments](https://developer.1password.com/docs/environment/)
|
||||
mount `.env` files as named pipes to inject secrets on-the-fly without writing them to disk.
|
||||
|
||||
No additional configuration is required — the plugin automatically detects and sources named pipes.
|
||||
|
||||
## Version Control
|
||||
|
||||
**It's strongly recommended to add `.env` file to `.gitignore`**, because usually it contains sensitive information such as your credentials, secret keys, passwords etc. You don't want to commit this file, it's supposed to be local only.
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
## Functions
|
||||
|
||||
source_env() {
|
||||
if [[ ! -f "$ZSH_DOTENV_FILE" ]]; then
|
||||
if [[ ! -f "$ZSH_DOTENV_FILE" ]] && [[ ! -p "$ZSH_DOTENV_FILE" ]]; then
|
||||
return
|
||||
fi
|
||||
|
||||
|
||||
@@ -385,9 +385,9 @@ kube_ps1() {
|
||||
local KUBE_PS1_RESET_COLOR="${_KUBE_PS1_OPEN_ESC}${_KUBE_PS1_DEFAULT_FG}${_KUBE_PS1_CLOSE_ESC}"
|
||||
|
||||
# If background color is set, reset color should also reset the background
|
||||
if [[ -n "${KUBE_PS1_BG_COLOR}" ]]; then
|
||||
KUBE_PS1_RESET_COLOR="${_KUBE_PS1_OPEN_ESC}${_KUBE_PS1_DEFAULT_FG}${_KUBE_PS1_DEFAULT_BG}${_KUBE_PS1_CLOSE_ESC}"
|
||||
fi
|
||||
# if [[ -n "${KUBE_PS1_BG_COLOR}" ]]; then
|
||||
# KUBE_PS1_RESET_COLOR="${_KUBE_PS1_OPEN_ESC}${_KUBE_PS1_DEFAULT_FG}${_KUBE_PS1_DEFAULT_BG}${_KUBE_PS1_CLOSE_ESC}"
|
||||
# fi
|
||||
|
||||
# Background Color
|
||||
[[ -n "${KUBE_PS1_BG_COLOR}" ]] && KUBE_PS1+="$(_kube_ps1_color_bg "${KUBE_PS1_BG_COLOR}")"
|
||||
|
||||
20
plugins/molecule/README.md
Normal file
20
plugins/molecule/README.md
Normal file
@@ -0,0 +1,20 @@
|
||||
# Molecule plugin
|
||||
|
||||
This plugin adds aliases and completion for [Molecule](https://ansible.readthedocs.io/projects/molecule/), the
|
||||
project designed to aid in the development and testing of Ansible roles..
|
||||
|
||||
To use it, add `molecule` to the plugins array in your zshrc file:
|
||||
|
||||
```zsh
|
||||
plugins=(... molecule)
|
||||
```
|
||||
|
||||
## Aliases
|
||||
|
||||
| Alias | Command | Description |
|
||||
| :---- | :---------------- | ---------------------------------------------------------------------------------- |
|
||||
| mol | molecule | Molecule aids in the development and testing of Ansible roles. |
|
||||
| mcr | molecule create | Use the provisioner to start the instances. |
|
||||
| mcon | molecule converge | Use the provisioner to configure instances (dependency, create, prepare converge). |
|
||||
| mls | molecule list | List status of instances. |
|
||||
| mvf | molecule verify | Run automated tests against instances. |
|
||||
22
plugins/molecule/molecule.plugin.zsh
Normal file
22
plugins/molecule/molecule.plugin.zsh
Normal file
@@ -0,0 +1,22 @@
|
||||
# Completion
|
||||
if (( ! $+commands[molecule] )); then
|
||||
return
|
||||
fi
|
||||
|
||||
# If the completion file doesn't exist yet, we need to autoload it and
|
||||
# bind it to `molecule`. Otherwise, compinit will have already done that.
|
||||
if [[ ! -f "$ZSH_CACHE_DIR/completions/_molecule" ]]; then
|
||||
typeset -g -A _comps
|
||||
autoload -Uz _molecule
|
||||
_comps[molecule]=_molecule
|
||||
fi
|
||||
|
||||
_MOLECULE_COMPLETE=zsh_source molecule >| "$ZSH_CACHE_DIR/completions/_molecule" &|
|
||||
|
||||
# Alias
|
||||
# molecule: https://docs.ansible.com/projects/molecule/
|
||||
alias mol='molecule'
|
||||
alias mcr='molecule create'
|
||||
alias mcon='molecule converge'
|
||||
alias mls='molecule list'
|
||||
alias mvf='molecule verify'
|
||||
@@ -5,8 +5,8 @@ if [[ -z $commands[thefuck] ]]; then
|
||||
fi
|
||||
|
||||
# Register alias
|
||||
[[ ! -a $ZSH_CACHE_DIR/thefuck ]] && thefuck --alias > $ZSH_CACHE_DIR/thefuck
|
||||
source $ZSH_CACHE_DIR/thefuck
|
||||
[[ ! -a "$ZSH_CACHE_DIR/thefuck" ]] && thefuck --alias > "$ZSH_CACHE_DIR/thefuck"
|
||||
source "$ZSH_CACHE_DIR/thefuck"
|
||||
|
||||
fuck-command-line() {
|
||||
local FUCK="$(THEFUCK_REQUIRE_CONFIRMATION=0 thefuck $(fc -ln -1 | tail -n 1) 2> /dev/null)"
|
||||
|
||||
@@ -4,6 +4,7 @@ function {
|
||||
$commands[virtualenvwrapper.sh] \
|
||||
/usr/share/virtualenvwrapper/virtualenvwrapper{_lazy,}.sh \
|
||||
/usr/local/bin/virtualenvwrapper{_lazy,}.sh \
|
||||
/usr/bin/virtualenvwrapper{_lazy,}.sh \
|
||||
/etc/bash_completion.d/virtualenvwrapper \
|
||||
/usr/share/bash-completion/completions/virtualenvwrapper \
|
||||
$HOME/.local/bin/virtualenvwrapper.sh
|
||||
|
||||
@@ -22,6 +22,6 @@ plugins=(... yum)
|
||||
| yi | `sudo yum install` | Install package |
|
||||
| ygi | `sudo yum groupinstall` | Install package group |
|
||||
| yr | `sudo yum remove` | Remove package |
|
||||
| ygr | `sudo yum groupremove` | Remove pagage group |
|
||||
| ygr | `sudo yum groupremove` | Remove package group |
|
||||
| yrl | `sudo yum remove --remove-leaves` | Remove package and leaves |
|
||||
| yc | `sudo yum clean all` | Clean yum cache |
|
||||
|
||||
@@ -55,9 +55,9 @@ _nlist_cursor_visibility() {
|
||||
[ "$1" = "1" ] && { tput cvvis; tput cnorm }
|
||||
[ "$1" = "0" ] && tput civis
|
||||
elif [ "$_nlist_has_terminfo" = "1" ]; then
|
||||
[ "$1" = "1" ] && { [ -n $terminfo[cvvis] ] && echo -n $terminfo[cvvis];
|
||||
[ -n $terminfo[cnorm] ] && echo -n $terminfo[cnorm] }
|
||||
[ "$1" = "0" ] && [ -n $terminfo[civis] ] && echo -n $terminfo[civis]
|
||||
[ "$1" = "1" ] && { [ -n "$terminfo[cvvis]" ] && echo -n "$terminfo[cvvis]";
|
||||
[ -n "$terminfo[cnorm]" ] && echo -n "$terminfo[cnorm]" }
|
||||
[ "$1" = "0" ] && [ -n "$terminfo[civis]" ] && echo -n "$terminfo[civis]"
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user