Browse Source

added oh-my-zsh, separated zsh configs by device

Josh Bicking 7 years ago
parent
commit
e4b6d4dbf3
9 changed files with 204 additions and 53 deletions
  1. 3 0
      .gitmodules
  2. 63 3
      makedots.sh
  3. 1 0
      oh-my-zsh
  4. 22 50
      zshrc
  5. 9 0
      zshrc.local.arch
  6. 5 0
      zshrc.local.cygwin
  7. 5 0
      zshrc.local.server
  8. 7 0
      zshrc.local.tablet
  9. 89 0
      zshrc.oh.my.zsh

+ 3 - 0
.gitmodules

@@ -35,3 +35,6 @@
 	path = vim/bundle/rust.vim
 	url = https://github.com/rust-lang/rust.vim
 	branch = master
+[submodule "oh-my-zsh"]
+	path = oh-my-zsh
+	url = https://github.com/robbyrussell/oh-my-zsh

+ 63 - 3
makedots.sh

@@ -1,10 +1,70 @@
+#!/bin/bash -e
+
 DIR=$(pwd)
 
-for i in vimrc vim zshrc zsh bashrc tmux.conf
+#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 ]
+then
+    echo "Please specify -o or -z for oh-my-zsh or standard zsh config."
+    exit
+fi
+
+if [ ! $TEMPLATE ]
+then
+    echo "Pleas specify -t [template suffix]. for a local zsh config."
+    exit
+fi
+
+# 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
+
+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" ]
+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
+fi
+
+for i in vimrc vim bashrc tmux.conf
 do
-    if [ -f $HOME/.$i ]
+if [ -f $HOME/.$i -o -h $HOME/.$i -o -d $HOME/.$i ]
     then
-        rm -i $HOME/.$i
+        rm -ri $HOME/.$i
     fi
     ln -s $DIR/$i $HOME/.$i
 done

+ 1 - 0
oh-my-zsh

@@ -0,0 +1 @@
+Subproject commit c24dfa1ab4abb1f28fad7666f3bc24f3abced801

+ 22 - 50
zshrc

@@ -1,49 +1,42 @@
-# Lines configured by zsh-newuser-install
+# local zsh config
+source ~/.zshrc.local
+
+# History
 HISTFILE=~/.histfile
-HISTSIZE=1000
-SAVEHIST=1000
+HISTSIZE=10000
+SAVEHIST=10000
+
+# Instantly write history
+setopt -o sharehistory
+
+# Ignore duplicates in history
+setopt HIST_IGNORE_DUPS
+
+# Delete old recorded entry if new entry is a duplicate.
+setopt HIST_IGNORE_ALL_DUPS 
+
 setopt appendhistory autocd extendedglob nomatch
+
 bindkey -e
-# End of lines configured by zsh-newuser-install
-# The following lines were added by compinstall
+
 zstyle :compinstall filename '/home/josh/.zshrc'
 
 autoload -Uz compinit
 compinit
-# End of lines added by compinstall
 
 # List of word delimeters
 WORDCHARS='*?_-.[]~=&;!#$%^(){}<>'
 
-# Use prompt colors (green for regular user, red for root)
-autoload -U colors && colors
-if [ "$(id -u)" != "0" ]; then
-    PROMPT="%{$fg_bold[green]%}%n@%m %1~ $%{$reset_color%} "
-    RPROMPT="[%{$fg_no_bold[yellow]%}%?%{$reset_color%}]"
-else
-    PROMPT="%{$fg_bold[red]%}%n@%m %1~ #%{$reset_color%} "
-    RPROMPT="[%{$fg_no_bold[yellow]%}%?%{$reset_color%}]"
-fi
-
 # ls pleasantness
 alias l='\ls --color=auto'
 alias ls='ls --color=auto'
 alias lsa='ls -a --color=auto'
-alias lls='ls -alh --color=auto'
-
-# apt-get aliases 
-alias update='sudo apt-get update && sudo apt-get dist-upgrade' 
-alias clean='sudo apt-get clean'
-
-# grep the entirety of the history
-alias hg='history 1 | grep'
+alias lls='ls -lh --color=auto'
+alias ll='ls -lh --color=auto'
 
 # Use vim as the default text editor
 export VISUAL=vim
 
-# Used to keep steam from throwing errors
-export SWT_GTK3=0
-
 # Home and End keysjump the the beginning/end of the command
 bindkey "^[OH" beginning-of-line
 bindkey "^[OF" end-of-line
@@ -54,21 +47,6 @@ bindkey ";5C" forward-word
 bindkey ";5D" backward-word
 # bindkey "^[[D" backward-word
 
-# Used for X forwarding in Cygwin
-if [[ "$(uname -o)" != "GNU/Linux" ]]; then
-    DISPLAY=:1.0
-fi
-
-# local folder in PATH for UE4
-export PATH=$HOME/bin:$PATH
-
-# Flags used for CS243 "Mechanics of Programming"
-alias gcc='gcc -std=c99 -Wall -ggdb -Wextra -pedantic'
-
-# devkitPro/devkitPPC sources
-export DEVKITPRO=/home/josh/devkitPro/ 
-export DEVKITPPC=/home/josh/devkitPro//devkitPPC
-
 # alias for vim muscle memory when quitting
 alias :q='exit'
 
@@ -77,14 +55,8 @@ if hash fuck 2>/dev/null; then
     eval $(thefuck --alias)
 fi
 
-# Instantly write history
-setopt -o sharehistory
-
-# Ignore duplicates in history
-setopt HIST_IGNORE_DUPS
-
 # timestamp alias for dates
 alias ts='date +%y-%m-%d'
 
-# zsh-syntax-highlighting (MUST BE AT THE BOTTOM OF THIS FILE)
-source ~/.zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
+# default to terminal emacs
+alias emacs='emacs -nw'

+ 9 - 0
zshrc.local.arch

@@ -0,0 +1,9 @@
+# Used to keep steam from throwing errors
+export SWT_GTK3=0
+
+# devkitPro/devkitPPC sources
+export DEVKITPRO=/home/josh/devkitPro/ 
+export DEVKITPPC=/home/josh/devkitPro/devkitPPC
+
+# local folder in PATH for UE4
+export PATH=$HOME/bin:$PATH

+ 5 - 0
zshrc.local.cygwin

@@ -0,0 +1,5 @@
+# Used for X forwarding in Cygwin
+if [[ "$(uname -o)" != "GNU/Linux" ]]; then
+    DISPLAY=:1.0
+fi
+

+ 5 - 0
zshrc.local.server

@@ -0,0 +1,5 @@
+# apt-get aliases 
+alias update='sudo apt-get update && sudo apt-get dist-upgrade' 
+alias clean='sudo apt-get clean'
+
+

+ 7 - 0
zshrc.local.tablet

@@ -0,0 +1,7 @@
+# apt-get aliases 
+alias update='sudo apt-get update && sudo apt-get dist-upgrade' 
+alias clean='sudo apt-get clean'
+
+# devkit
+export DEVKITPRO=/mnt/data/devkitPro
+export DEVKITARM=${DEVKITPRO}/devkitARM

+ 89 - 0
zshrc.oh.my.zsh

@@ -0,0 +1,89 @@
+# Custom zsh configs
+source ~/.zshrc.mine
+
+# If you come from bash you might have to change your $PATH.
+# export PATH=$HOME/bin:/usr/local/bin:$PATH
+
+# Path to your oh-my-zsh installation.
+  export ZSH=/home/josh/.oh-my-zsh
+
+# Set name of the theme to load. Optionally, if you set this to "random"
+# it'll load a random theme each time that oh-my-zsh is loaded.
+# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
+#ZSH_THEME="robbyrussell"   # default
+ZSH_THEME="agnoster"
+
+# Uncomment the following line to use case-sensitive completion.
+# CASE_SENSITIVE="true"
+
+# Uncomment the following line to use hyphen-insensitive completion. Case
+# sensitive completion must be off. _ and - will be interchangeable.
+# HYPHEN_INSENSITIVE="true"
+
+# Uncomment the following line to disable bi-weekly auto-update checks.
+# DISABLE_AUTO_UPDATE="true"
+
+# Uncomment the following line to change how often to auto-update (in days).
+# export UPDATE_ZSH_DAYS=13
+
+# Uncomment the following line to disable colors in ls.
+# DISABLE_LS_COLORS="true"
+
+# Uncomment the following line to disable auto-setting terminal title.
+# DISABLE_AUTO_TITLE="true"
+
+# Uncomment the following line to enable command auto-correction.
+# ENABLE_CORRECTION="true"
+
+# Uncomment the following line to display red dots whilst waiting for completion.
+# COMPLETION_WAITING_DOTS="true"
+
+# Uncomment the following line if you want to disable marking untracked files
+# under VCS as dirty. This makes repository status check for large repositories
+# much, much faster.
+# DISABLE_UNTRACKED_FILES_DIRTY="true"
+
+# Uncomment the following line if you want to change the command execution time
+# stamp shown in the history command output.
+# The optional three formats: "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
+# HIST_STAMPS="mm/dd/yyyy"
+
+# Would you like to use another custom folder than $ZSH/custom?
+# ZSH_CUSTOM=/path/to/new-custom-folder
+
+# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
+# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
+# Example format: plugins=(rails git textmate ruby lighthouse)
+# Add wisely, as too many plugins slow down shell startup.
+plugins=(git zsh-syntax-highlighting)
+
+source $ZSH/oh-my-zsh.sh
+
+# User configuration
+
+# export MANPATH="/usr/local/man:$MANPATH"
+
+# You may need to manually set your language environment
+# export LANG=en_US.UTF-8
+
+# Preferred editor for local and remote sessions
+# if [[ -n $SSH_CONNECTION ]]; then
+#   export EDITOR='vim'
+# else
+#   export EDITOR='mvim'
+# fi
+
+# Compilation flags
+# export ARCHFLAGS="-arch x86_64"
+
+# ssh
+# export SSH_KEY_PATH="~/.ssh/dsa_id"
+
+# Set personal aliases, overriding those provided by oh-my-zsh libs,
+# plugins, and themes. Aliases can be placed here, though oh-my-zsh
+# users are encouraged to define aliases within the ZSH_CUSTOM folder.
+# For a full list of active aliases, run `alias`.
+#
+# Example aliases
+# alias zshconfig="mate ~/.zshrc"
+# alias ohmyzsh="mate ~/.oh-my-zsh"