mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-01-25 01:47:25 +08:00
Compare commits
No commits in common. "cd17aed9e109692273b5c251414ee733cba704f2" and "03b6a72576cb0f0b53abde25d409e8026d5c4ee9" have entirely different histories.
cd17aed9e1
...
03b6a72576
@ -273,7 +273,7 @@ DISABLE_AUTO_UPDATE=true
|
|||||||
If you'd like to upgrade at any point in time (maybe someone just released a new plugin and you don't want to wait a week?) you just need to run:
|
If you'd like to upgrade at any point in time (maybe someone just released a new plugin and you don't want to wait a week?) you just need to run:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
omz update
|
upgrade_oh_my_zsh
|
||||||
```
|
```
|
||||||
|
|
||||||
Magic! 🎉
|
Magic! 🎉
|
||||||
|
|||||||
@ -14,14 +14,6 @@
|
|||||||
|
|
||||||
sudo-command-line() {
|
sudo-command-line() {
|
||||||
[[ -z $BUFFER ]] && LBUFFER="$(fc -ln -1)"
|
[[ -z $BUFFER ]] && LBUFFER="$(fc -ln -1)"
|
||||||
|
|
||||||
# Save beginning space
|
|
||||||
local WHITESPACE=""
|
|
||||||
if [[ ${LBUFFER:0:1} == " " ]] ; then
|
|
||||||
WHITESPACE=" "
|
|
||||||
LBUFFER="${LBUFFER:1}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ -n $EDITOR && $BUFFER == $EDITOR\ * ]]; then
|
if [[ -n $EDITOR && $BUFFER == $EDITOR\ * ]]; then
|
||||||
if [[ ${#LBUFFER} -le ${#EDITOR} ]]; then
|
if [[ ${#LBUFFER} -le ${#EDITOR} ]]; then
|
||||||
RBUFFER=" ${BUFFER#$EDITOR }"
|
RBUFFER=" ${BUFFER#$EDITOR }"
|
||||||
@ -46,9 +38,6 @@ sudo-command-line() {
|
|||||||
else
|
else
|
||||||
LBUFFER="sudo $LBUFFER"
|
LBUFFER="sudo $LBUFFER"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Preserve beginning space
|
|
||||||
LBUFFER="${WHITESPACE}${LBUFFER}"
|
|
||||||
}
|
}
|
||||||
zle -N sudo-command-line
|
zle -N sudo-command-line
|
||||||
# Defined shortcut keys: [Esc] [Esc]
|
# Defined shortcut keys: [Esc] [Esc]
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user