Ver código fonte

added antigen

Josh Bicking 8 anos atrás
pai
commit
d456b90e9f
3 arquivos alterados com 59 adições e 60 exclusões
  1. 1 0
      antigen
  2. 22 47
      makedots.sh
  3. 36 13
      zshrc

+ 1 - 0
antigen

@@ -0,0 +1 @@
+Subproject commit 55d49fdf23359bb1f2ea5ff51494eab2b71e2c15

+ 22 - 47
makedots.sh

@@ -2,65 +2,30 @@
 
 DIR=$(pwd)
 
-#while getopts "ozgt:" opt; do
-while getopts "ozt:" opt; do
-    case "$opt" in
-        o)  CONFIG="OHMYZSH"
-            ;;
-        z)  CONFIG="ZSH"
-            ;;
-#        g)  CONFIG="GRML"
-#            ;;
-        t)  TEMPLATE=$OPTARG
-    esac
-done
-
-if [ ! $CONFIG ]
+# Choose only the template
+if [ ! $1 ]
 then
-    echo "Please specify -o or -z for oh-my-zsh or standard zsh config."
+    echo "Please specify [template suffix]. for a local zsh config."
     exit
 fi
 
-if [ ! $TEMPLATE ]
-then
-    echo "Pleas specify -t [template suffix]. for a local zsh config."
-    exit
-fi
 
-# Template
+# Install Template
 if [ -f $HOME/.zshrc.local -o -h $HOME/.zshrc.local -o -d $HOME/.zshrc.local ]
 then
     rm -i $HOME/.zshrc.local
 fi
-ln -s $DIR/zshrc.local.$TEMPLATE $HOME/.zshrc.local
+ln -s $DIR/zshrc.local.$1 $HOME/.zshrc.local
 
-if [ $CONFIG == "OHMYZSH" ]
-then
-    for i in zshrc oh.my.zsh zshrc.mine
-    do
-        if [ -f $HOME/.$i -o -h $HOME/.$i -o -d $HOME/.$i ]
-        then
-            rm -ri $HOME/.$i
-        fi
-    done
-    ln -s $DIR/zshrc.oh.my.zsh $HOME/.zshrc
-    ln -s $DIR/zshrc $HOME/.zshrc.mine
-    ln -s $DIR/oh-my-zsh $HOME/.oh-my-zsh
-fi
 
-if [ $CONFIG == "ZSH" ]
+# Install all dotfiles
+if [ -f $HOME/.zshrc -o -h $HOME/.zshrc -o -d $HOME/.zshrc ]
 then
-    for i in zshrc zsh 
-    do
-        if [ -f $HOME/.$i -o -h $HOME/.$i -o -d $HOME/.$i ]
-        then
-            rm -ri $HOME/.$i
-        fi
-        ln -s $DIR/$i $HOME/.$i
-    done
+    rm -ri $HOME/.zshrc
 fi
+ln -s $DIR/zshrc $HOME/.zshrc
 
-for i in vimrc vim bashrc tmux.conf
+for i in vimrc vim bashrc tmux.conf zshrc
 do
 if [ -f $HOME/.$i -o -h $HOME/.$i -o -d $HOME/.$i ]
     then
@@ -69,9 +34,19 @@ if [ -f $HOME/.$i -o -h $HOME/.$i -o -d $HOME/.$i ]
     ln -s $DIR/$i $HOME/.$i
 done
 
+
+# Nvim
 mkdir -p .config/
-if [ -d .config/nvim ]
+if [ -d $HOME/.config/nvim ]
 then
-    rm -ri .config/nvim
+    rm -ri $HOME/.config/nvim
 fi
 ln -s $DIR/vim $HOME/.config/nvim
+
+
+# Antigen
+if [ -e $HOME/.antigen.zsh ]
+then
+    rm -i $HOME/.antigen.zsh
+fi
+ln -s $DIR/antigen/antigen.zsh $HOME/.antigen.zsh

+ 36 - 13
zshrc

@@ -1,7 +1,36 @@
 # local zsh config
 source ~/.zshrc.local
 
+# load antigen if it exists
+if [ -e ~/.antigen.zsh ]
+then
+
+    source ~/.antigen.zsh
+
+    # Load oh-my-zsh's library.
+    antigen use oh-my-zsh
+
+    # Bundles from the default repo (robbyrussell's oh-my-zsh).
+    antigen bundle git
+    antigen bundle heroku
+    antigen bundle pip
+    antigen bundle lein
+    antigen bundle command-not-found
+
+    # Syntax highlighting bundle.
+    antigen bundle zsh-users/zsh-syntax-highlighting
+
+    # Load the theme.
+    antigen theme agnoster
+
+    # Tell antigen that you're done.
+    antigen apply
+
+fi
+
+
 # History
+
 HISTFILE=~/.histfile
 HISTSIZE=10000
 SAVEHIST=10000
@@ -38,10 +67,6 @@ alias ll='ls -lh --color=auto'
 # Use vim as the default text editor
 export VISUAL=vim
 
-# Home and End keysjump the the beginning/end of the command
-bindkey "^[OH" beginning-of-line
-bindkey "^[OF" end-of-line
-
 # Ctrl-Left and Ctrl-Right keys move between words
 bindkey ";5C" forward-word
 # bindkey "^[[C" forward-word
@@ -88,13 +113,11 @@ RPS1="${${KEYMAP/vicmd/$VIM_PROMPT}/(main|viins)/} $EPS1"
 zle -N zle-line-init
 zle -N zle-keymap-select
 
-# grml
-if [ ! $ZSH_CUSTOM ]
-then
-    # enable syntax highlighting
-    source ~/.zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
-
-    # enable C-s for forward search
-    stty -ixon
-fi
+# Home and End keys jump the the beginning/end of the command
+bindkey "^[OH" beginning-of-line
+bindkey "^[[H" beginning-of-line
+bindkey "^[OF" end-of-line
+bindkey "^[[F" end-of-line
 
+# Enable forward search
+bindkey "^s" history-incremental-search-forward