My initial dotfiles config

James Peret 11 years ago
commit
62f34559a4
2 changed files with 116 additions and 0 deletions
  1. 59 0
      makesymlinks.sh
  2. 57 0
      zshrc

+ 59 - 0
makesymlinks.sh

@@ -0,0 +1,59 @@
1
+#!/bin/bash
2
+############################
3
+# .make.sh
4
+# This script creates symlinks from the home directory to any desired dotfiles in ~/dotfiles
5
+############################
6
+
7
+########## Variables
8
+
9
+dir=~/dotfiles                    # dotfiles directory
10
+olddir=~/dotfiles_old             # old dotfiles backup directory
11
+files="bashrc vimrc vim zshrc oh-my-zsh private scrotwm.conf Xresources"    # list of files/folders to symlink in homedir
12
+
13
+##########
14
+
15
+# create dotfiles_old in homedir
16
+echo -n "Creating $olddir for backup of any existing dotfiles in ~ ..."
17
+mkdir -p $olddir
18
+echo "done"
19
+
20
+# change to the dotfiles directory
21
+echo -n "Changing to the $dir directory ..."
22
+cd $dir
23
+echo "done"
24
+
25
+# move any existing dotfiles in homedir to dotfiles_old directory, then create symlinks from the homedir to any files in the ~/dotfiles directory specified in $files
26
+for file in $files; do
27
+    echo "Moving any existing dotfiles from ~ to $olddir"
28
+    mv ~/.$file ~/dotfiles_old/
29
+    echo "Creating symlink to $file in home directory."
30
+    ln -s $dir/$file ~/.$file
31
+done
32
+
33
+function install_zsh {
34
+# Test to see if zshell is installed.  If it is:
35
+if [ -f /bin/zsh -o -f /usr/bin/zsh ]; then
36
+    # Clone my oh-my-zsh repository from GitHub only if it isn't already present
37
+    if [[ ! -d $dir/oh-my-zsh/ ]]; then
38
+        git clone http://github.com/michaeljsmalley/oh-my-zsh.git
39
+    fi
40
+    # Set the default shell to zsh if it isn't currently set to zsh
41
+    if [[ ! $(echo $SHELL) == $(which zsh) ]]; then
42
+        chsh -s $(which zsh)
43
+    fi
44
+else
45
+    # If zsh isn't installed, get the platform of the current machine
46
+    platform=$(uname);
47
+    # If the platform is Linux, try an apt-get to install zsh and then recurse
48
+    if [[ $platform == 'Linux' ]]; then
49
+        sudo apt-get install zsh
50
+        install_zsh
51
+    # If the platform is OS X, tell the user to install zsh :)
52
+    elif [[ $platform == 'Darwin' ]]; then
53
+        echo "Please install zsh, then re-run this script!"
54
+        exit
55
+    fi
56
+fi
57
+}
58
+
59
+# install_zsh

+ 57 - 0
zshrc

@@ -0,0 +1,57 @@
1
+# Path to your oh-my-zsh configuration.
2
+ZSH=$HOME/.oh-my-zsh
3
+
4
+# Set name of the theme to load.
5
+# Look in ~/.oh-my-zsh/themes/
6
+# Optionally, if you set this to "random", it'll load a random theme each
7
+# time that oh-my-zsh is loaded.
8
+ZSH_THEME="clean"
9
+
10
+# Example aliases
11
+# alias zshconfig="mate ~/.zshrc"
12
+# alias ohmyzsh="mate ~/.oh-my-zsh"
13
+
14
+# Set to this to use case-sensitive completion
15
+# CASE_SENSITIVE="true"
16
+
17
+# Comment this out to disable bi-weekly auto-update checks
18
+# DISABLE_AUTO_UPDATE="true"
19
+
20
+# Uncomment to change how many often would you like to wait before auto-updates occur? (in days)
21
+# export UPDATE_ZSH_DAYS=13
22
+
23
+# Uncomment following line if you want to disable colors in ls
24
+# DISABLE_LS_COLORS="true"
25
+
26
+# Uncomment following line if you want to disable autosetting terminal title.
27
+# DISABLE_AUTO_TITLE="true"
28
+
29
+# Uncomment following line if you want red dots to be displayed while waiting for completion
30
+# COMPLETION_WAITING_DOTS="true"
31
+
32
+# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
33
+# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
34
+# Example format: plugins=(rails git textmate ruby lighthouse gem bundler brew)
35
+plugins=(git)
36
+
37
+source $ZSH/oh-my-zsh.sh
38
+
39
+
40
+
41
+# My Old Shell
42
+
43
+# TextMate
44
+export TEXTMATE_PATH=/Applications/TextMate.app/Contents/Resources/mate
45
+mate () {
46
+    $TEXTMATE_PATH $1 $2 $3 $4 $5 $6
47
+}
48
+export EDITOR="$TEXTMATE_PATH -w"
49
+export LC_CTYPE=en_US.UTF-8
50
+
51
+export EDITOR=pico
52
+
53
+# Get the aliases and functions
54
+if [ -f ~/.bash_aliases ]; then
55
+. ~/.bash_aliases
56
+fi
57
+