mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-01-21 00:57:24 +08:00
Compare commits
No commits in common. "97134d1eed19b72a9c4bf90a2effa847221608bf" and "4fcf52c2b1e086596d96b04f9c1ff3d742194857" have entirely different histories.
97134d1eed
...
4fcf52c2b1
1
.github/PULL_REQUEST_TEMPLATE.md
vendored
1
.github/PULL_REQUEST_TEMPLATE.md
vendored
@ -9,7 +9,6 @@
|
||||
- [ ] The code is mine or it's from somewhere with an MIT-compatible license.
|
||||
- [ ] The code is efficient, to the best of my ability, and does not waste computer resources.
|
||||
- [ ] The code is stable and I have tested it myself, to the best of my abilities.
|
||||
- [ ] If the code introduces new aliases, I provide a valid use case for all plugin users down below.
|
||||
|
||||
## Changes:
|
||||
|
||||
|
||||
@ -104,27 +104,6 @@ maintainers) by mentioning their GitHub handle (starting with `@`) in your messa
|
||||
|
||||
For any extensive change, such as a new plugin, you will have to find testers to +1 your PR.
|
||||
|
||||
### New plugin aliases
|
||||
|
||||
We acknowledge that aliases are a core part of Oh My Zsh. There are plugins that have +100 aliases!
|
||||
|
||||
This has become an issue for two opposing reasons:
|
||||
|
||||
- Some users want to have their personal aliases in Oh My Zsh.
|
||||
- Some users don't want any aliases at all and feel that there are too many.
|
||||
|
||||
Because of this, from now on we're requiring that new aliases follow these conditions:
|
||||
|
||||
1. They will be used by many people, not just a few.
|
||||
2. The aliases will be used many times and for common tasks.
|
||||
3. Prefer one generic alias over many specific ones.
|
||||
4. When justifying the need for an alias, talk about workflows where you'll use it,
|
||||
preferably in combination with other aliases.
|
||||
5. If there exists a command with the same name, look for a different alias name.
|
||||
|
||||
This list is not exhaustive! Please remember that your alias will be in the machines of many people,
|
||||
so it should be justified why they should have it.
|
||||
|
||||
----
|
||||
|
||||
## Use the Search, Luke
|
||||
|
||||
30
lib/cli.zsh
30
lib/cli.zsh
@ -280,10 +280,9 @@ multi == 1 && length(\$0) > 0 {
|
||||
"
|
||||
|
||||
local zdot="${ZDOTDIR:-$HOME}"
|
||||
local zshrc="${${:-"${zdot}/.zshrc"}:A}"
|
||||
awk "$awk_script" "$zshrc" > "$zdot/.zshrc.new" \
|
||||
&& command cp -f "$zshrc" "$zdot/.zshrc.bck" \
|
||||
&& command mv -f "$zdot/.zshrc.new" "$zshrc"
|
||||
awk "$awk_script" "$zdot/.zshrc" > "$zdot/.zshrc.new" \
|
||||
&& command mv -f "$zdot/.zshrc" "$zdot/.zshrc.bck" \
|
||||
&& command mv -f "$zdot/.zshrc.new" "$zdot/.zshrc"
|
||||
|
||||
# Exit if the new .zshrc file wasn't created correctly
|
||||
[[ $? -eq 0 ]] || {
|
||||
@ -295,7 +294,8 @@ multi == 1 && length(\$0) > 0 {
|
||||
# Exit if the new .zshrc file has syntax errors
|
||||
if ! command zsh -n "$zdot/.zshrc"; then
|
||||
_omz::log error "broken syntax in '"${zdot/#$HOME/\~}/.zshrc"'. Rolling back changes..."
|
||||
command mv -f "$zdot/.zshrc.bck" "$zshrc"
|
||||
command mv -f "$zdot/.zshrc" "$zdot/.zshrc.new"
|
||||
command mv -f "$zdot/.zshrc.bck" "$zdot/.zshrc"
|
||||
return 1
|
||||
fi
|
||||
|
||||
@ -354,10 +354,9 @@ multi == 1 && /^[^#]*\)/ {
|
||||
"
|
||||
|
||||
local zdot="${ZDOTDIR:-$HOME}"
|
||||
local zshrc="${${:-"${zdot}/.zshrc"}:A}"
|
||||
awk "$awk_script" "$zshrc" > "$zdot/.zshrc.new" \
|
||||
&& command cp -f "$zshrc" "$zdot/.zshrc.bck" \
|
||||
&& command mv -f "$zdot/.zshrc.new" "$zshrc"
|
||||
awk "$awk_script" "$zdot/.zshrc" > "$zdot/.zshrc.new" \
|
||||
&& command mv -f "$zdot/.zshrc" "$zdot/.zshrc.bck" \
|
||||
&& command mv -f "$zdot/.zshrc.new" "$zdot/.zshrc"
|
||||
|
||||
# Exit if the new .zshrc file wasn't created correctly
|
||||
[[ $? -eq 0 ]] || {
|
||||
@ -369,7 +368,8 @@ multi == 1 && /^[^#]*\)/ {
|
||||
# Exit if the new .zshrc file has syntax errors
|
||||
if ! command zsh -n "$zdot/.zshrc"; then
|
||||
_omz::log error "broken syntax in '"${zdot/#$HOME/\~}/.zshrc"'. Rolling back changes..."
|
||||
command mv -f "$zdot/.zshrc.bck" "$zshrc"
|
||||
command mv -f "$zdot/.zshrc" "$zdot/.zshrc.new"
|
||||
command mv -f "$zdot/.zshrc.bck" "$zdot/.zshrc"
|
||||
return 1
|
||||
fi
|
||||
|
||||
@ -715,8 +715,7 @@ END {
|
||||
'
|
||||
|
||||
local zdot="${ZDOTDIR:-$HOME}"
|
||||
local zshrc="${${:-"${zdot}/.zshrc"}:A}"
|
||||
awk "$awk_script" "$zshrc" > "$zdot/.zshrc.new" \
|
||||
awk "$awk_script" "$zdot/.zshrc" > "$zdot/.zshrc.new" \
|
||||
|| {
|
||||
# Prepend ZSH_THEME= line to .zshrc if it doesn't exist
|
||||
cat <<EOF
|
||||
@ -725,8 +724,8 @@ ZSH_THEME="$1" # set by \`omz\`
|
||||
EOF
|
||||
cat "$zdot/.zshrc"
|
||||
} > "$zdot/.zshrc.new" \
|
||||
&& command cp -f "$zshrc" "$zdot/.zshrc.bck" \
|
||||
&& command mv -f "$zdot/.zshrc.new" "$zshrc"
|
||||
&& command mv -f "$zdot/.zshrc" "$zdot/.zshrc.bck" \
|
||||
&& command mv -f "$zdot/.zshrc.new" "$zdot/.zshrc"
|
||||
|
||||
# Exit if the new .zshrc file wasn't created correctly
|
||||
[[ $? -eq 0 ]] || {
|
||||
@ -738,7 +737,8 @@ EOF
|
||||
# Exit if the new .zshrc file has syntax errors
|
||||
if ! command zsh -n "$zdot/.zshrc"; then
|
||||
_omz::log error "broken syntax in '"${zdot/#$HOME/\~}/.zshrc"'. Rolling back changes..."
|
||||
command mv -f "$zdot/.zshrc.bck" "$zshrc"
|
||||
command mv -f "$zdot/.zshrc" "$zdot/.zshrc.new"
|
||||
command mv -f "$zdot/.zshrc.bck" "$zdot/.zshrc"
|
||||
return 1
|
||||
fi
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user