mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-01-24 01:37:27 +08:00
Compare commits
14 Commits
3247f7eb59
...
b6d93de4ab
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b6d93de4ab | ||
|
|
ddec79ad43 | ||
|
|
0ebeae78d0 | ||
|
|
3b66f643e4 | ||
|
|
953f526dea | ||
|
|
1b4497fc8f | ||
|
|
a98a9f7122 | ||
|
|
b58bf31444 | ||
|
|
f246f4612a | ||
|
|
ca467bd9d9 | ||
|
|
5889f4cfc9 | ||
|
|
3cb5a9097b | ||
|
|
aa9043f5ea | ||
|
|
bc0433e518 |
6
.github/workflows/dependencies.yml
vendored
6
.github/workflows/dependencies.yml
vendored
@ -13,17 +13,17 @@ jobs:
|
|||||||
contents: write # this is needed to push commits and branches
|
contents: write # this is needed to push commits and branches
|
||||||
steps:
|
steps:
|
||||||
- name: Harden the runner (Audit all outbound calls)
|
- name: Harden the runner (Audit all outbound calls)
|
||||||
uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2
|
uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3
|
||||||
with:
|
with:
|
||||||
egress-policy: audit
|
egress-policy: audit
|
||||||
|
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
|
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- name: Authenticate as @ohmyzsh
|
- name: Authenticate as @ohmyzsh
|
||||||
id: generate-token
|
id: generate-token
|
||||||
uses: actions/create-github-app-token@7e473efe3cb98aa54f8d4bac15400b15fad77d94 # v2.2.0
|
uses: actions/create-github-app-token@29824e69f54612133e76f7eaac726eef6c875baf # v2.2.1
|
||||||
with:
|
with:
|
||||||
app-id: ${{ secrets.OHMYZSH_APP_ID }}
|
app-id: ${{ secrets.OHMYZSH_APP_ID }}
|
||||||
private-key: ${{ secrets.OHMYZSH_APP_PRIVATE_KEY }}
|
private-key: ${{ secrets.OHMYZSH_APP_PRIVATE_KEY }}
|
||||||
|
|||||||
@ -4,4 +4,4 @@ idna==3.11
|
|||||||
PyYAML==6.0.3
|
PyYAML==6.0.3
|
||||||
requests==2.32.5
|
requests==2.32.5
|
||||||
semver==3.0.4
|
semver==3.0.4
|
||||||
urllib3==2.5.0
|
urllib3==2.6.0
|
||||||
|
|||||||
8
.github/workflows/installer.yml
vendored
8
.github/workflows/installer.yml
vendored
@ -26,12 +26,12 @@ jobs:
|
|||||||
- macos-latest
|
- macos-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Harden the runner (Audit all outbound calls)
|
- name: Harden the runner (Audit all outbound calls)
|
||||||
uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2
|
uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3
|
||||||
with:
|
with:
|
||||||
egress-policy: audit
|
egress-policy: audit
|
||||||
|
|
||||||
- name: Set up git repository
|
- name: Set up git repository
|
||||||
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
|
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
||||||
- name: Install zsh
|
- name: Install zsh
|
||||||
if: runner.os == 'Linux'
|
if: runner.os == 'Linux'
|
||||||
run: sudo apt-get update; sudo apt-get install zsh
|
run: sudo apt-get update; sudo apt-get install zsh
|
||||||
@ -47,12 +47,12 @@ jobs:
|
|||||||
- test
|
- test
|
||||||
steps:
|
steps:
|
||||||
- name: Harden the runner (Audit all outbound calls)
|
- name: Harden the runner (Audit all outbound calls)
|
||||||
uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2
|
uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3
|
||||||
with:
|
with:
|
||||||
egress-policy: audit
|
egress-policy: audit
|
||||||
|
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
|
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
||||||
- name: Install Vercel CLI
|
- name: Install Vercel CLI
|
||||||
run: npm install -g vercel
|
run: npm install -g vercel
|
||||||
- name: Setup project and deploy
|
- name: Setup project and deploy
|
||||||
|
|||||||
4
.github/workflows/main.yml
vendored
4
.github/workflows/main.yml
vendored
@ -24,12 +24,12 @@ jobs:
|
|||||||
if: github.repository == 'ohmyzsh/ohmyzsh'
|
if: github.repository == 'ohmyzsh/ohmyzsh'
|
||||||
steps:
|
steps:
|
||||||
- name: Harden the runner (Audit all outbound calls)
|
- name: Harden the runner (Audit all outbound calls)
|
||||||
uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2
|
uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3
|
||||||
with:
|
with:
|
||||||
egress-policy: audit
|
egress-policy: audit
|
||||||
|
|
||||||
- name: Set up git repository
|
- name: Set up git repository
|
||||||
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
|
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
||||||
- name: Install zsh
|
- name: Install zsh
|
||||||
run: sudo apt-get update; sudo apt-get install zsh
|
run: sudo apt-get update; sudo apt-get install zsh
|
||||||
- name: Check syntax
|
- name: Check syntax
|
||||||
|
|||||||
4
.github/workflows/project.yml
vendored
4
.github/workflows/project.yml
vendored
@ -17,12 +17,12 @@ jobs:
|
|||||||
if: github.repository == 'ohmyzsh/ohmyzsh'
|
if: github.repository == 'ohmyzsh/ohmyzsh'
|
||||||
steps:
|
steps:
|
||||||
- name: Harden the runner (Audit all outbound calls)
|
- name: Harden the runner (Audit all outbound calls)
|
||||||
uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2
|
uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3
|
||||||
with:
|
with:
|
||||||
egress-policy: audit
|
egress-policy: audit
|
||||||
- name: Authenticate as @ohmyzsh
|
- name: Authenticate as @ohmyzsh
|
||||||
id: generate-token
|
id: generate-token
|
||||||
uses: actions/create-github-app-token@7e473efe3cb98aa54f8d4bac15400b15fad77d94 # v2.2.0
|
uses: actions/create-github-app-token@29824e69f54612133e76f7eaac726eef6c875baf # v2.2.1
|
||||||
with:
|
with:
|
||||||
app-id: ${{ secrets.OHMYZSH_APP_ID }}
|
app-id: ${{ secrets.OHMYZSH_APP_ID }}
|
||||||
private-key: ${{ secrets.OHMYZSH_APP_PRIVATE_KEY }}
|
private-key: ${{ secrets.OHMYZSH_APP_PRIVATE_KEY }}
|
||||||
|
|||||||
6
.github/workflows/scorecard.yml
vendored
6
.github/workflows/scorecard.yml
vendored
@ -36,12 +36,12 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Harden the runner (Audit all outbound calls)
|
- name: Harden the runner (Audit all outbound calls)
|
||||||
uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2
|
uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3
|
||||||
with:
|
with:
|
||||||
egress-policy: audit
|
egress-policy: audit
|
||||||
|
|
||||||
- name: "Checkout code"
|
- name: "Checkout code"
|
||||||
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
|
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
||||||
with:
|
with:
|
||||||
persist-credentials: false
|
persist-credentials: false
|
||||||
|
|
||||||
@ -60,6 +60,6 @@ jobs:
|
|||||||
retention-days: 5
|
retention-days: 5
|
||||||
|
|
||||||
- name: "Upload to code-scanning"
|
- name: "Upload to code-scanning"
|
||||||
uses: github/codeql-action/upload-sarif@fdbfb4d2750291e159f0156def62b853c2798ca2 # v4.31.5
|
uses: github/codeql-action/upload-sarif@cf1bb45a277cb3c205638b2cd5c984db1c46a412 # v4.31.7
|
||||||
with:
|
with:
|
||||||
sarif_file: results.sarif
|
sarif_file: results.sarif
|
||||||
|
|||||||
@ -56,27 +56,110 @@ autoload -Uz is-at-least
|
|||||||
if is-at-least 4.2.0; then
|
if is-at-least 4.2.0; then
|
||||||
# open browser on urls
|
# open browser on urls
|
||||||
if [[ -n "$BROWSER" ]]; then
|
if [[ -n "$BROWSER" ]]; then
|
||||||
_browser_fts=(htm html de org net com at cx nl se dk)
|
_browser_fts=(htm html xhtml)
|
||||||
for ft in $_browser_fts; do alias -s $ft='$BROWSER'; done
|
for ft in $_browser_fts; do alias -s $ft='$BROWSER'; done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
_editor_fts=(cpp cxx cc c hh h inl asc txt TXT tex)
|
# open editable text files in text editor
|
||||||
for ft in $_editor_fts; do alias -s $ft='$EDITOR'; done
|
if [[ -n "$VISUAL" ]] || [[ -n "$EDITOR" ]]; then
|
||||||
|
_aliases_launch_editor() {
|
||||||
|
# directly launch matched files with executable bit and shebang present
|
||||||
|
if [[ -x "${1}" ]]; then
|
||||||
|
read -r <"${1}"
|
||||||
|
if [[ ${#REPLY} -ge 3 ]] && [[ ${REPLY:0:2} = '#!' ]]; then
|
||||||
|
"$@"
|
||||||
|
return $?
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ -n "$VISUAL" ]]; then
|
||||||
|
$VISUAL "$@"
|
||||||
|
else
|
||||||
|
$EDITOR "$@"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
# Taken from the /language/metadata/property[name="globs"] sections of the
|
||||||
|
# gtksourceview language definition files in
|
||||||
|
# /usr/share/gtksourceview-3.0/language-specs/*.lang
|
||||||
|
_editor_fts=(
|
||||||
|
abnf as adb ads 4th forth asp am awk prg bib bsv boo cg h c cmake ctest
|
||||||
|
cbl cob cbd cdb cdc hh hp hpp h++ cpp cxx cc C c++ cs css CSSL csv cu cuh
|
||||||
|
desktop kdelnk diff patch rej d docbook bat cmd sys dot gv dpatch dtd dtl
|
||||||
|
e eif erl hrl fcl frt fs f f90 f95 for F F90 fs g gd gi gap gdb gs glslv
|
||||||
|
glslf go groovy hs lhs hx pro idl igm ini jade pug java js node ijs json
|
||||||
|
geojson topojson jl kt tex ltx sty cls dtx ins bbl l lex flex la lai lo
|
||||||
|
ll logcat lua m4 ac in make mak mk page markdown md mkd m mac MAC dem DEM
|
||||||
|
wxm WXM build mo mop mxml n nrx nai nsh m j ml mli mll mly ocl ooc sign
|
||||||
|
impl cl p pas txt TXT pl pm al perl t php php3 php4 phtml pig pc po pot
|
||||||
|
prolog proto pp py3 py pyw R Rout r Rhistory Rtspec rst rb rake gemspe rs
|
||||||
|
scala scm sce sci sh bash sml sig rq sql rnw Rnw snw Snw swift sv svh t2t
|
||||||
|
tcl tk tera texi texinfo thrift toml tml lock vala vapi vb v vhd xml xspf
|
||||||
|
siv smil smi sml kino xul xbel abw zabw glabe jnlp mml rdf rss wml xmi fo
|
||||||
|
xslfo xslt xsl y yacc yaml yml
|
||||||
|
)
|
||||||
|
for ft in $_editor_fts; do alias -s $ft=_aliases_launch_editor; done
|
||||||
|
fi
|
||||||
|
|
||||||
|
# open image files in image viewer
|
||||||
if [[ -n "$XIVIEWER" ]]; then
|
if [[ -n "$XIVIEWER" ]]; then
|
||||||
_image_fts=(jpg jpeg png gif mng tiff tif xpm)
|
# List inspired by https://en.wikipedia.org/wiki/Image_file_formats
|
||||||
|
_image_fts=(
|
||||||
|
#: Raster formats
|
||||||
|
# JPEG, JPEG2000, HEIF/HEVC, JBIG
|
||||||
|
jpg jpeg jpe jif jfif jfi jp2 j2k jpf jpx jpm mj2 heif heic jbg jbig
|
||||||
|
# BMP, BPG, GIF, ICO/ANI, PCX, PNG+MNG, TGA, TIFF, WebP (Web)
|
||||||
|
bmp bpg gif dib ico cur ani pcx png mng tga tiff tif webp
|
||||||
|
# NetPBM, XBM/XPM/XWD (ASCII)
|
||||||
|
pbm bgm ppm pnm xbm xpm xwd
|
||||||
|
# CIFF, DNG, DPX, ECW, FITS, ICS, RGBE (HDR & Raw)
|
||||||
|
crw dng dpx ecw fits ics ids fit fts hdr
|
||||||
|
# DDS ICNS OpenRaster SunRaster (Other)
|
||||||
|
dds icns ora ras sun
|
||||||
|
#: Vector formats
|
||||||
|
# CGM WMF Gerber IGES SVG
|
||||||
|
cgm wmf emf wmz emz gbr iges svg svgz
|
||||||
|
)
|
||||||
for ft in $_image_fts; do alias -s $ft='$XIVIEWER'; done
|
for ft in $_image_fts; do alias -s $ft='$XIVIEWER'; done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
_media_fts=(ape avi flv m4a mkv mov mp3 mpeg mpg ogg ogm rm wav webm)
|
if [[ -n "$XMVIEWER" ]]; then
|
||||||
for ft in $_media_fts; do alias -s $ft=mplayer; done
|
_media_fts=(
|
||||||
|
#: Audio (container) formats
|
||||||
|
# https://en.wikipedia.org/wiki/Audio_file_format#List_of_formats
|
||||||
|
aac act aiff ape au awb dct dss flac gsm m4a m4b mp3 mpc oga opus ra sln
|
||||||
|
tta vox wav wma wv
|
||||||
|
#: Video (container) formats
|
||||||
|
# https://en.wikipedia.org/wiki/Video_file_format#List_of_video_file_formats
|
||||||
|
mkv flv f4v f4p f4a f4b vob ogv drc gifv avi mov qt wmv yuv rmvb asf amv
|
||||||
|
m4v mpg mp2 m2v mpeg mpe mpv svi 3g2 mxf nsv
|
||||||
|
#: Container formats that may store both
|
||||||
|
3gp ogg mogg mp4 m4p rm webm
|
||||||
|
)
|
||||||
|
for ft in $_media_fts; do alias -s $ft=$XMVIEWER; done
|
||||||
|
fi
|
||||||
|
|
||||||
#read documents
|
#open complex document formats using the system viewer
|
||||||
alias -s pdf=acroread
|
_document_fts=(
|
||||||
alias -s ps=gv
|
# Long-term storage formats
|
||||||
alias -s dvi=xdvi
|
djvu dvi fb2 epub pdf ps rtf
|
||||||
alias -s chm=xchm
|
# Office Binary & Office OpenXML
|
||||||
alias -s djvu=djview
|
doc docx docm ppt pptx pptm xls xlsx xlsm
|
||||||
|
# OpenDocument
|
||||||
|
odt fodt ods fods odp fodp odg fodg odf
|
||||||
|
# Uniform Office Format
|
||||||
|
uof uot uos uop
|
||||||
|
# StarOffice
|
||||||
|
sdw sxw sdc sxc sdd sci sda sxd smf sxm
|
||||||
|
# WordPerfect
|
||||||
|
wpd wp wp4 wp5 wp6 wp7
|
||||||
|
# Others
|
||||||
|
abw gnm gnumeric pages hwp
|
||||||
|
)
|
||||||
|
if type xdg-open >/dev/null; then
|
||||||
|
for ft in $_document_fts; do alias -s $ft=xdg-open; done
|
||||||
|
elif type open >/dev/null; then
|
||||||
|
for ft in $_document_fts; do alias -s $ft=open; done
|
||||||
|
fi
|
||||||
|
|
||||||
#list whats inside packed file
|
#list whats inside packed file
|
||||||
alias -s zip="unzip -l"
|
alias -s zip="unzip -l"
|
||||||
|
|||||||
@ -12,6 +12,16 @@ plugins=(... jj)
|
|||||||
|
|
||||||
| Alias | Command |
|
| Alias | Command |
|
||||||
| ------ | ----------------------------- |
|
| ------ | ----------------------------- |
|
||||||
|
| jjb | `jj bookmark` |
|
||||||
|
| jjbc | `jj bookmark create` |
|
||||||
|
| jjbd | `jj bookmark delete` |
|
||||||
|
| jjbf | `jj bookmark forget` |
|
||||||
|
| jjbl | `jj bookmark list` |
|
||||||
|
| jjbm | `jj bookmark move` |
|
||||||
|
| jjbr | `jj bookmark rename` |
|
||||||
|
| jjbs | `jj bookmark set` |
|
||||||
|
| jjbt | `jj bookmark track` |
|
||||||
|
| jjbu | `jj bookmark untrack` |
|
||||||
| jjc | `jj commit` |
|
| jjc | `jj commit` |
|
||||||
| jjcmsg | `jj commit --message` |
|
| jjcmsg | `jj commit --message` |
|
||||||
| jjd | `jj diff` |
|
| jjd | `jj diff` |
|
||||||
@ -22,14 +32,20 @@ plugins=(... jj)
|
|||||||
| jjgf | `jj git fetch` |
|
| jjgf | `jj git fetch` |
|
||||||
| jjgfa | `jj git fetch --all-remotes` |
|
| jjgfa | `jj git fetch --all-remotes` |
|
||||||
| jjgp | `jj git push` |
|
| jjgp | `jj git push` |
|
||||||
|
| jjgpa | `jj git push --all` |
|
||||||
|
| jjgpd | `jj git push --deleted` |
|
||||||
|
| jjgpt | `jj git push --tracked` |
|
||||||
| jjl | `jj log` |
|
| jjl | `jj log` |
|
||||||
| jjla | `jj log -r "all()"` |
|
| jjla | `jj log -r "all()"` |
|
||||||
| jjn | `jj new` |
|
| jjn | `jj new` |
|
||||||
|
| jjnt | `jj new "trunk()"` |
|
||||||
| jjrb | `jj rebase` |
|
| jjrb | `jj rebase` |
|
||||||
|
| jjrbm | `jj rebase -d "trunk()"` |
|
||||||
| jjrs | `jj restore` |
|
| jjrs | `jj restore` |
|
||||||
| jjrt | `cd "$(jj root \|\| echo .)"` |
|
| jjrt | `cd "$(jj root \|\| echo .)"` |
|
||||||
| jjsp | `jj split` |
|
| jjsp | `jj split` |
|
||||||
| jjsq | `jj squash` |
|
| jjsq | `jj squash` |
|
||||||
|
| jjst | `jj status` |
|
||||||
|
|
||||||
## Prompt usage
|
## Prompt usage
|
||||||
|
|
||||||
@ -88,3 +104,4 @@ that.
|
|||||||
## Contributors
|
## Contributors
|
||||||
|
|
||||||
- [nasso](https://github.com/nasso) - Plugin Author
|
- [nasso](https://github.com/nasso) - Plugin Author
|
||||||
|
- [imp](https://github.com/imp) - Occasional Alias Contributor
|
||||||
|
|||||||
@ -34,6 +34,16 @@ function jj_prompt_template() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Aliases (sorted alphabetically)
|
# Aliases (sorted alphabetically)
|
||||||
|
alias jjb='jj bookmark'
|
||||||
|
alias jjbc='jj bookmark create'
|
||||||
|
alias jjbd='jj bookmark delete'
|
||||||
|
alias jjbf='jj bookmark forget'
|
||||||
|
alias jjbl='jj bookmark list'
|
||||||
|
alias jjbm='jj bookmark move'
|
||||||
|
alias jjbr='jj bookmark rename'
|
||||||
|
alias jjbs='jj bookmark set'
|
||||||
|
alias jjbt='jj bookmark track'
|
||||||
|
alias jjbu='jj bookmark untrack'
|
||||||
alias jjc='jj commit'
|
alias jjc='jj commit'
|
||||||
alias jjcmsg='jj commit --message'
|
alias jjcmsg='jj commit --message'
|
||||||
alias jjd='jj diff'
|
alias jjd='jj diff'
|
||||||
@ -44,11 +54,17 @@ alias jjgcl='jj git clone'
|
|||||||
alias jjgf='jj git fetch'
|
alias jjgf='jj git fetch'
|
||||||
alias jjgfa='jj git fetch --all-remotes'
|
alias jjgfa='jj git fetch --all-remotes'
|
||||||
alias jjgp='jj git push'
|
alias jjgp='jj git push'
|
||||||
|
alias jjgpa='jj git push --all'
|
||||||
|
alias jjgpd='jj git push --deleted'
|
||||||
|
alias jjgpt='jj git push --tracked'
|
||||||
alias jjl='jj log'
|
alias jjl='jj log'
|
||||||
alias jjla='jj log -r "all()"'
|
alias jjla='jj log -r "all()"'
|
||||||
alias jjn='jj new'
|
alias jjn='jj new'
|
||||||
|
alias jjnt='jj new "trunk()"'
|
||||||
alias jjrb='jj rebase'
|
alias jjrb='jj rebase'
|
||||||
|
alias jjrbm='jj rebase -d "trunk()"'
|
||||||
alias jjrs='jj restore'
|
alias jjrs='jj restore'
|
||||||
alias jjrt='cd "$(jj root || echo .)"'
|
alias jjrt='cd "$(jj root || echo .)"'
|
||||||
alias jjsp='jj split'
|
alias jjsp='jj split'
|
||||||
alias jjsq='jj squash'
|
alias jjsq='jj squash'
|
||||||
|
alias jjst='jj status'
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user