Znap! No more antibody
This commit is contained in:
parent
7be213b759
commit
e90c4f0549
4 changed files with 61 additions and 35 deletions
|
@ -18,9 +18,11 @@ elif [[ $(uname) == "Linux" ]]; then
|
|||
elif [[ $(command -v dnf) ]]; then
|
||||
sudo dnf install ansible -y
|
||||
fi
|
||||
elif [[ $(uname) == "Darwin" && ! $(command -v brew) ]]; then
|
||||
# Yeah, raw brew install
|
||||
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
|
||||
elif [[ $(uname) == "Darwin" ]]; then
|
||||
if [[ ! $(command -v brew)]]; then
|
||||
# Yeah, raw brew install
|
||||
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
|
||||
fi
|
||||
/usr/local/bin/brew install ansible
|
||||
fi
|
||||
|
||||
|
|
|
@ -1,15 +1,4 @@
|
|||
---
|
||||
- name: Get antibody install script
|
||||
get_url:
|
||||
url: https://git.io/antibody
|
||||
dest: /tmp/get_antibody.sh
|
||||
mode: 0755
|
||||
|
||||
- name: Install antibody
|
||||
shell: /tmp/get_antibody.sh -b ~/bin
|
||||
args:
|
||||
creates: ~/bin/antibody
|
||||
|
||||
- name: Symlink zsh_plugins.txt
|
||||
file:
|
||||
src: ~/.dotfiles/zsh/zsh_plugins.txt
|
||||
|
|
|
@ -1,11 +1,4 @@
|
|||
robbyrussell/oh-my-zsh path:plugins/git
|
||||
robbyrussell/oh-my-zsh path:plugins/vi-mode
|
||||
robbyrussell/oh-my-zsh path:plugins/gitignore
|
||||
robbyrussell/oh-my-zsh path:plugins/pass
|
||||
robbyrussell/oh-my-zsh path:plugins/ripgrep
|
||||
|
||||
|
||||
zsh-users/zsh-syntax-highlighting
|
||||
zsh-users/zsh-completions
|
||||
ress997/zsh-completions-anyenv
|
||||
Tarrasch/zsh-bd
|
||||
https://github.com/ohmyzsh/oh-my-zsh
|
||||
https://github.com/zsh-users/zsh-syntax-highlighting
|
||||
https://github.com/zsh-users/zsh-completions
|
||||
https://github.com/ress997/zsh-completions-anyenv
|
||||
|
|
62
zsh/zshrc
62
zsh/zshrc
|
@ -8,6 +8,7 @@ export RPROMPT=' ' # Fixes a side-effect of the vi-mode oh-my-zsh plugin
|
|||
export KEYTIMEOUT=1
|
||||
|
||||
typeset -U path
|
||||
typeset -U fpath
|
||||
|
||||
fpath=(~/bin ~/.zshcompletions $fpath)
|
||||
zstyle :compinstall filename '/home/anthonys/.zshrc'
|
||||
|
@ -28,18 +29,44 @@ zle -N down-line-or-beginning-search
|
|||
[[ -n "$key[Up]" ]] && bindkey -- "$key[Up]" up-line-or-beginning-search
|
||||
[[ -n "$key[Down]" ]] && bindkey -- "$key[Down]" down-line-or-beginning-search
|
||||
|
||||
autoload -Uz compinit promptinit
|
||||
promptinit
|
||||
compinit
|
||||
|
||||
export COMPLETION_WAITING_DOTS="true"
|
||||
export VISUAL='nvim'
|
||||
export EDITOR='nvim'
|
||||
path=("$HOME/bin" "$HOME/go/bin" $path)
|
||||
|
||||
source <(antibody init)
|
||||
local ZSH_PLUGIN_DIR="$HOME/.zsh_plugins"
|
||||
if [[ ! -d "${ZSH_PLUGIN_DIR}/zsh-snap" ]]; then
|
||||
mkdir -p ~/.zsh_plugins
|
||||
cd ~/.zsh_plugins
|
||||
git clone https://github.com/marlonrichert/zsh-snap.git
|
||||
fi
|
||||
zstyle ':znap:*' plugins-dir "${ZSH_PLUGIN_DIR}"
|
||||
|
||||
antibody bundle < ~/.zsh_plugins.txt
|
||||
source "${ZSH_PLUGIN_DIR}/zsh-snap/znap.zsh" && export ZNAP_USED=1
|
||||
local -a paths
|
||||
for line in "${(@f)"$(<~/.zsh_plugins.txt)"}"
|
||||
{
|
||||
if [[ ! -d "${ZSH_PLUGIN_DIR}/$(basename $line)" ]]; then
|
||||
paths=($paths $line)
|
||||
fi
|
||||
}
|
||||
|
||||
if [[ ! ${#paths[@]} -eq 0 ]]; then
|
||||
echo "Paths not empty: $paths"
|
||||
znap clone ${^paths}
|
||||
fi
|
||||
|
||||
if [[ ( $ZNAP_USED = 1 ) ]]; then
|
||||
znap source oh-my-zsh lib/{git,completion}
|
||||
znap source oh-my-zsh plugins/vi-mode
|
||||
fpath=($fpath "$(znap path oh-my-zsh)/plugins/pass")
|
||||
fpath=($fpath "$(znap path oh-my-zsh)/plugins/ripgrep")
|
||||
fpath=($fpath "$(znap path oh-my-zsh)/plugins/cargo")
|
||||
znap source zsh-syntax-highlighting
|
||||
znap source zsh-completions
|
||||
znap source zsh-completions-anyenv
|
||||
fi
|
||||
|
||||
if [[ -d ~/.cargo/bin ]]; then
|
||||
path=($HOME/.cargo/bin $path)
|
||||
|
@ -48,9 +75,18 @@ fi
|
|||
if [[ $(whence -p starship 2> /dev/null) ]]; then
|
||||
eval "$(starship init zsh)"
|
||||
else
|
||||
antibody bundle denysdovhan/spaceship-prompt
|
||||
if [[ ( $ZNAP_USED = 1 ) ]]; then
|
||||
znap clone https://github.com/denysdovhan/spaceship-prompt
|
||||
fi
|
||||
znap prompt spaceship-prompt
|
||||
fi
|
||||
|
||||
autoload -Uz compinit promptinit
|
||||
promptinit
|
||||
compinit
|
||||
|
||||
znap source oh-my-zsh plugins/gitignore
|
||||
|
||||
alias exa="exa -l --git"
|
||||
if [[ $(uname -s) =~ 'Linux' ]]; then
|
||||
alias cp="cp --reflink=auto"
|
||||
|
@ -101,8 +137,15 @@ function edit() {
|
|||
eval "${editor}"
|
||||
}
|
||||
|
||||
path+=($HOME/.anyenv/bin)
|
||||
eval "$(anyenv init -)"
|
||||
if [[ -d $HOME/.anyenv ]]; then
|
||||
path+=($HOME/.anyenv/bin)
|
||||
if [[ ( $ZNAP_USED = 1 ) ]]; then
|
||||
znap eval anyenv-init 'anyenv init -'
|
||||
else
|
||||
eval "$(anyenv init -)"
|
||||
fi
|
||||
fi
|
||||
|
||||
path+=($(yarn global bin))
|
||||
export PATH
|
||||
|
||||
|
@ -120,5 +163,4 @@ fi
|
|||
for funcfile in $(ls $HOME/.zsh.d/); do
|
||||
source ${HOME}/.zsh.d/${funcfile}
|
||||
done
|
||||
autoload -U +X bashcompinit && bashcompinit
|
||||
complete -o nospace -C /usr/local/bin/bitcomplete bit
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue