From 8c19ef6bcfba51c562b3c979db8f9d6cd6ae9919 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Fri, 24 Jun 2016 16:57:00 +0200 Subject: Load plugins via zplug --- tag-zplug/config/zsh/zshenv | 0 tag-zplug/config/zsh/zshrc | 64 +++++++++++++++++++++++++++++++++++++++++++++ tag-zplug/zshenv | 3 +++ 3 files changed, 67 insertions(+) create mode 100644 tag-zplug/config/zsh/zshenv create mode 100644 tag-zplug/config/zsh/zshrc create mode 100644 tag-zplug/zshenv diff --git a/tag-zplug/config/zsh/zshenv b/tag-zplug/config/zsh/zshenv new file mode 100644 index 0000000..e69de29 diff --git a/tag-zplug/config/zsh/zshrc b/tag-zplug/config/zsh/zshrc new file mode 100644 index 0000000..dc55d6d --- /dev/null +++ b/tag-zplug/config/zsh/zshrc @@ -0,0 +1,64 @@ +# -*- mode: sh; -*- +export ZPLUG_HOME=/usr/local/opt/zplug +source $ZPLUG_HOME/init.zsh + +zplug "zsh-users/zsh-completions" +zplug "mafredri/zsh-async" +zplug "sindresorhus/pure" +zplug "Tarrasch/zsh-autoenv", as:plugin +zplug "clvv/fasd", hook-build:"make install" +zplug "tymm/zsh-directory-history", as:command, use:"dir{hist,log}" +zplug "tymm/zsh-directory-history", as:plugin + +if zplug check Tarrasch/zsh-autoenv +then + AUTOENV_FILE_ENTER=.envrc + AUTOENV_HANDLE_LEAVE=0 + AUTOENV_LOOK_UPWARDS=1 +fi + +# Then, source plugins and add commands to $PATH +zplug load + +# General configuration +setopt auto_cd # Change directories without `cd` + +if zplug check zsh-users/zsh-completions +then + autoload -U compinit && compinit +fi + +if zplug check sindresorhus/pure +then + PURE_GIT_PULL=0 + autoload -Uz promptinit && promptinit + prompt pure &> /dev/null +fi + +if zplug check clvv/fasd +then + if [[ -n $commands[fasd] ]] + then + _FASD_DATA="$HOME/.cache/zsh/fasd-data" + source =fasd + + fasd_cache="$HOME/.fasd-init-zsh" + if [ "$(command -v fasd)" -nt "$fasd_cache" -o ! -s "$fasd_cache" ]; then + fasd --init posix-alias zsh-hook zsh-ccomp zsh-ccomp-install >| "$fasd_cache" + fi + source "$fasd_cache" + unset fasd_cache + else + echo "no fasd" + fi +fi + +if zplug check tymm/zsh-directory-history +then + unsetopt flow_control # Let me use ^S and ^Q + # bindkey '\e[A' directory-history-search-backward + # bindkey '\e[B' directory-history-search-forward + + bindkey -M emacs '^R' history-substring-search-up + bindkey -M emacs '^S' history-substring-search-down +fi diff --git a/tag-zplug/zshenv b/tag-zplug/zshenv new file mode 100644 index 0000000..354c54d --- /dev/null +++ b/tag-zplug/zshenv @@ -0,0 +1,3 @@ +ZDOTDIR="${XDG_CONFIG_HOME:=$HOME/.config}/zsh" + +source "$ZDOTDIR"/.zshenv -- cgit 1.4.1 From 665d0c79f6c3167ca125666cedd85e8c29a47bdc Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Fri, 24 Jun 2016 16:57:11 +0200 Subject: Load plugins via antibody --- tag-antibody/config/zsh/plugins.txt | 7 +++++++ tag-antibody/config/zsh/zshenv | 0 tag-antibody/config/zsh/zshrc | 42 +++++++++++++++++++++++++++++++++++++ tag-antibody/zshenv | 3 +++ 4 files changed, 52 insertions(+) create mode 100644 tag-antibody/config/zsh/plugins.txt create mode 100644 tag-antibody/config/zsh/zshenv create mode 100644 tag-antibody/config/zsh/zshrc create mode 100644 tag-antibody/zshenv diff --git a/tag-antibody/config/zsh/plugins.txt b/tag-antibody/config/zsh/plugins.txt new file mode 100644 index 0000000..361bad3 --- /dev/null +++ b/tag-antibody/config/zsh/plugins.txt @@ -0,0 +1,7 @@ +zsh-users/zsh-completions +mafredri/zsh-async +Tarrasch/zsh-autoenv +caarlos0/zsh-git-sync +caarlos0/zsh-open-pr +sindresorhus/pure +clvv/fasd diff --git a/tag-antibody/config/zsh/zshenv b/tag-antibody/config/zsh/zshenv new file mode 100644 index 0000000..e69de29 diff --git a/tag-antibody/config/zsh/zshrc b/tag-antibody/config/zsh/zshrc new file mode 100644 index 0000000..3a9722c --- /dev/null +++ b/tag-antibody/config/zsh/zshrc @@ -0,0 +1,42 @@ +source <(antibody init) + +AUTOENV_FILE_ENTER=.envrc +AUTOENV_HANDLE_LEAVE=0 +AUTOENV_LOOK_UPWARDS=1 + +PURE_GIT_PULL=0 + +source $ZDOTDIR/load-plugins.zsh + +function update_antibody () { + antibody bundle < .config/zsh/plugins.txt| xargs -I {} echo "source {}" >> .config/zsh/load-plugins.zsh +} + + +# General configuration +setopt auto_cd # Change directories without `cd` + +autoload -U compinit && compinit +autoload -Uz promptinit && promptinit + +if [[ -n $commands[fasd] ]] +then + _FASD_DATA="$HOME/.cache/zsh/fasd-data" + source =fasd + + fasd_cache="$HOME/.fasd-init-zsh" + if [ "$(command -v fasd)" -nt "$fasd_cache" -o ! -s "$fasd_cache" ]; then + fasd --init posix-alias zsh-hook zsh-ccomp zsh-ccomp-install >| "$fasd_cache" + fi + source "$fasd_cache" + unset fasd_cache +else + echo "no fasd" +fi + +unsetopt flow_control # Let me use ^S and ^Q +# bindkey '\e[A' directory-history-search-backward +# bindkey '\e[B' directory-history-search-forward + +# bindkey -M emacs '^R' history-substring-search-up +# bindkey -M emacs '^S' history-substring-search-down diff --git a/tag-antibody/zshenv b/tag-antibody/zshenv new file mode 100644 index 0000000..354c54d --- /dev/null +++ b/tag-antibody/zshenv @@ -0,0 +1,3 @@ +ZDOTDIR="${XDG_CONFIG_HOME:=$HOME/.config}/zsh" + +source "$ZDOTDIR"/.zshenv -- cgit 1.4.1 From f766b7ba9ee98fe81a0b17581177314c57443818 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sun, 26 Jun 2016 16:34:09 +0200 Subject: Zplug: Allow installing into $HOME --- host-ap-spotcap.local/config/zsh/zshenv.local | 1 + tag-zplug/config/zsh/zshenv | 6 ++++++ tag-zplug/config/zsh/zshrc | 5 ++--- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/host-ap-spotcap.local/config/zsh/zshenv.local b/host-ap-spotcap.local/config/zsh/zshenv.local index f6881be..35fe7a3 100644 --- a/host-ap-spotcap.local/config/zsh/zshenv.local +++ b/host-ap-spotcap.local/config/zsh/zshenv.local @@ -3,3 +3,4 @@ if [[ -e $HOME/.nix-profile/etc/profile.d/nix.sh ]] then . $HOME/.nix-profile/etc/profile.d/nix.sh; fi +export ZPLUG_HOME=/usr/local/opt/zplug diff --git a/tag-zplug/config/zsh/zshenv b/tag-zplug/config/zsh/zshenv index e69de29..d5ef76a 100644 --- a/tag-zplug/config/zsh/zshenv +++ b/tag-zplug/config/zsh/zshenv @@ -0,0 +1,6 @@ +if [[ -f $ZDOTDIR/zshenv.local ]] +then + . $ZDOTDIR/zshenv.local +fi + +ZPLUG_HOME=${ZPLUG_HOME:-~/projects/zplug} \ No newline at end of file diff --git a/tag-zplug/config/zsh/zshrc b/tag-zplug/config/zsh/zshrc index dc55d6d..5fd52db 100644 --- a/tag-zplug/config/zsh/zshrc +++ b/tag-zplug/config/zsh/zshrc @@ -1,12 +1,11 @@ # -*- mode: sh; -*- -export ZPLUG_HOME=/usr/local/opt/zplug -source $ZPLUG_HOME/init.zsh +source ${ZPLUG_HOME:-~/projects/zplug}/init.zsh zplug "zsh-users/zsh-completions" zplug "mafredri/zsh-async" zplug "sindresorhus/pure" zplug "Tarrasch/zsh-autoenv", as:plugin -zplug "clvv/fasd", hook-build:"make install" +zplug "clvv/fasd", hook-build:"PREFIX=$HOME make install" zplug "tymm/zsh-directory-history", as:command, use:"dir{hist,log}" zplug "tymm/zsh-directory-history", as:plugin -- cgit 1.4.1 From dd4e62c2ea197c6cf63b65a7b5160fb19dbd5939 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sun, 26 Jun 2016 16:35:38 +0200 Subject: Delete unused tmux stuff --- tag-zsh/config/zsh/completion/_tmux_pane_words | 10 ---------- tag-zsh/config/zsh/zshrc | 10 ---------- 2 files changed, 20 deletions(-) delete mode 100644 tag-zsh/config/zsh/completion/_tmux_pane_words diff --git a/tag-zsh/config/zsh/completion/_tmux_pane_words b/tag-zsh/config/zsh/completion/_tmux_pane_words deleted file mode 100644 index 6ff9ce1..0000000 --- a/tag-zsh/config/zsh/completion/_tmux_pane_words +++ /dev/null @@ -1,10 +0,0 @@ -local expl -local -a w - -if [[ -z "$TMUX_PANE" ]]; then - _message "not running inside tmux!" - return 1 -fi - -w=( ${(u)=$(tmux capture-pane \; show-buffer \; delete-buffer)} ) -_wanted values expl 'words from current tmux pane' compadd -a w diff --git a/tag-zsh/config/zsh/zshrc b/tag-zsh/config/zsh/zshrc index 73dad6d..38d4a7a 100755 --- a/tag-zsh/config/zsh/zshrc +++ b/tag-zsh/config/zsh/zshrc @@ -57,13 +57,6 @@ bashcompinit zstyle :compinstall filename '~/.zshrc' -autoload -Uz _tmux_pane_words -zle -C tmux-pane-words-prefix complete-word _generic -zle -C tmux-pane-words-anywhere complete-word _generic -zstyle ':completion:tmux-pane-words-(prefix|anywhere):*' completer _tmux_pane_words -zstyle ':completion:tmux-pane-words-(prefix|anywhere):*' ignore-line current -zstyle ':completion:tmux-pane-words-anywhere:*' matcher-list 'b:=* m:{A-Za-z}={a-zA-Z}' - # Speed up completion by not going further than a full match zstyle ':completion:*' accept-exact '*(N)' @@ -192,9 +185,6 @@ bindkey '' forward-word bindkey 'f' insert-files bindkey 'd' describe-key-briefly -bindkey '\' tmux-pane-words-prefix -bindkey '|' tmux-pane-words-anywhere - # Aliases before functions alias getcflags='gcc -\#\#\# -march=native -E /usr/include/stdlib.h 2>&1 | grep "/usr/libexec/gcc/.*cc1"' alias grep='grep --color=auto' -- cgit 1.4.1 From 3ec45a3b60b4d4ae0a778ed1d0e417c3a20c4d57 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sun, 26 Jun 2016 16:41:04 +0200 Subject: Set zsh plugin dependencies --- tag-zplug/config/zsh/zshrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tag-zplug/config/zsh/zshrc b/tag-zplug/config/zsh/zshrc index 5fd52db..c57bf94 100644 --- a/tag-zplug/config/zsh/zshrc +++ b/tag-zplug/config/zsh/zshrc @@ -3,7 +3,7 @@ source ${ZPLUG_HOME:-~/projects/zplug}/init.zsh zplug "zsh-users/zsh-completions" zplug "mafredri/zsh-async" -zplug "sindresorhus/pure" +zplug "sindresorhus/pure", on:"mafredri/zsh-async" zplug "Tarrasch/zsh-autoenv", as:plugin zplug "clvv/fasd", hook-build:"PREFIX=$HOME make install" zplug "tymm/zsh-directory-history", as:command, use:"dir{hist,log}" -- cgit 1.4.1 From 1f77e2ab95dac41dc40d6d449f92654b607f4b45 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sun, 26 Jun 2016 16:42:21 +0200 Subject: Setup zplug in post-zsh hook --- hooks/post-up/zsh | 34 ++++------------------------------ 1 file changed, 4 insertions(+), 30 deletions(-) diff --git a/hooks/post-up/zsh b/hooks/post-up/zsh index 15b6a2f..b7a7d4a 100755 --- a/hooks/post-up/zsh +++ b/hooks/post-up/zsh @@ -21,35 +21,9 @@ then mkdir -p ~/.cache/zsh fi -local -a zfiles -zfiles=($ZDOTDIR/zshrc) - -autoload -U zrecompile - -if [[ -f $ZDOTDIR/${HOST%%.*}.zsh ]]; then - zfiles+=$ZDOTDIR/${HOST%%.*}.zsh -fi -if [[ $OSTYPE == freebsd* ]]; then - zfiles+=$ZDOTDIR/freebsd.zsh -fi - -autoload -Uz compinit -compinit -u -d ~/.cache/zsh/compdump -zrecompile -p -R $ZDOTDIR/.zshrc.zwc $zfiles -- \ - -M ~/.cache/zsh/compdump - -if [[ -s $commands[fasd] ]]; then - if [[ ! -d $ZDOTDIR/functions/fasd ]]; then - mkdir $ZDOTDIR/functions/fasd - fi - if [[ ! -h $ZDOTDIR/functions/fasd/fasd ]]; then - ln -s =fasd $ZDOTDIR/functions/fasd/fasd - fi +if [[ -z $commands[zplug] && ! -d ~/projects/zplug/ ]] +then + git clone git://github.com/zplug/zplug ~/projects/zplug/ fi -for fp in $ZDOTDIR/functions/*(/); do - zrecompile -p $fp $fp/* -done - -[[ -f ~/.zsh/fasd-data ]] && mv ~/.zsh/fasd-data ~/.cache/zsh/fasd-data -[[ -f ~/.zsh/history ]] && mv ~/.zsh/history ~/.cache/zsh/history +zsh -ic "zplug install" -- cgit 1.4.1 From 097663cb10d0e8c244063af28295cff6d686f1bb Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sun, 26 Jun 2016 16:48:06 +0200 Subject: Port WORDCHARS config from zsh --- tag-zplug/config/zsh/zshrc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tag-zplug/config/zsh/zshrc b/tag-zplug/config/zsh/zshrc index c57bf94..71722dc 100644 --- a/tag-zplug/config/zsh/zshrc +++ b/tag-zplug/config/zsh/zshrc @@ -9,6 +9,8 @@ zplug "clvv/fasd", hook-build:"PREFIX=$HOME make install" zplug "tymm/zsh-directory-history", as:command, use:"dir{hist,log}" zplug "tymm/zsh-directory-history", as:plugin +WORDCHARS='*?_-[]~.&;!#$%^(){}<>' + if zplug check Tarrasch/zsh-autoenv then AUTOENV_FILE_ENTER=.envrc -- cgit 1.4.1