1
0
mirror of https://github.com/frebib/dotfiles.git synced 2024-06-14 12:57:23 +00:00

Antigen is a broken piece of shit

This commit is contained in:
Joe Groocock 2017-11-16 00:24:10 +00:00
parent f879258646
commit da62525a0b
Signed by: frebib
GPG Key ID: E0B16BEACFBB6A86
3 changed files with 26 additions and 2 deletions

View File

@ -0,0 +1,19 @@
# Source: https://github.com/robbyrussell/oh-my-zsh/blob/master/plugins/sudo/sudo.plugin.zsh
sudo-command-line() {
[[ -z $BUFFER ]] && zle up-history
if [[ $BUFFER == sudo\ * ]]; then
LBUFFER="${LBUFFER#sudo }"
elif [[ $BUFFER == $EDITOR\ * ]]; then
LBUFFER="${LBUFFER#$EDITOR }"
LBUFFER="sudoedit $LBUFFER"
elif [[ $BUFFER == sudoedit\ * ]]; then
LBUFFER="${LBUFFER#sudoedit }"
LBUFFER="$EDITOR $LBUFFER"
else
LBUFFER="sudo $LBUFFER"
fi
}
zle -N sudo-command-line
# Defined shortcut keys: [Esc] [Esc]
bindkey "\e\e" sudo-command-line

9
.zshrc
View File

@ -53,7 +53,6 @@ if [ ! -f "$antigen_src" ]; then
fi fi
source "$antigen_src" source "$antigen_src"
antigen bundle sudo
antigen bundle zsh-users/zsh-completions antigen bundle zsh-users/zsh-completions
antigen bundle zsh-users/zsh-autosuggestions antigen bundle zsh-users/zsh-autosuggestions
antigen bundle Tarrasch/zsh-syntax-highlighting antigen bundle Tarrasch/zsh-syntax-highlighting
@ -119,5 +118,11 @@ ZSH_HIGHLIGHT_STYLES[back-dollar-quoted-argument]='fg=cyan'
ZSH_HIGHLIGHT_STYLES[assign]='fg=green' ZSH_HIGHLIGHT_STYLES[assign]='fg=green'
ZSH_HIGHLIGHT_STYLES[redirection]='fg=cyan' ZSH_HIGHLIGHT_STYLES[redirection]='fg=cyan'
source "$ZSH_DIR/fish-theme.zsh"
source "$DOTFILES/aliases" source "$DOTFILES/aliases"
# Load some manual plugins
source "$ZSH_DIR/plugins/sudo.zsh"
source "$ZSH_DIR/plugins/fish-theme.zsh"
# Reload zsh-syntax-highlighting, because reasons -_-
source "$ADOTDIR/bundles/Tarrasch/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh"