diff --git a/.config/brew_cask_list.txt b/.config/brew_cask_list.txt
new file mode 100644
index 0000000..6f9472d
--- /dev/null
+++ b/.config/brew_cask_list.txt
@@ -0,0 +1,11 @@
+alfred
+android-studio
+calibre
+google-chrome
+iterm2
+skype
+slack
+sourcetree
+spectacle
+spotify
+visual-studio-code
diff --git a/powerline-shell/config.json b/.config/powerline-shell/config.json
similarity index 100%
rename from powerline-shell/config.json
rename to .config/powerline-shell/config.json
diff --git a/.config/vscode_extensions.txt b/.config/vscode_extensions.txt
new file mode 100644
index 0000000..e07c923
--- /dev/null
+++ b/.config/vscode_extensions.txt
@@ -0,0 +1,7 @@
+dbaeumer.vscode-eslint
+eamodio.gitlens
+Orta.vscode-jest
+ryanluker.vscode-coverage-gutters
+shd101wyy.markdown-preview-enhanced
+vscodevim.vim
+vsmobile.vscode-react-native
diff --git a/.functions/backup_brew_cask_list.sh b/.functions/backup_brew_cask_list.sh
new file mode 100644
index 0000000..db1f895
--- /dev/null
+++ b/.functions/backup_brew_cask_list.sh
@@ -0,0 +1,3 @@
+backup_brew_cask_list() {
+ brew cask list > $DOTFILES_DIR/.config/brew_cask_list.txt
+}
\ No newline at end of file
diff --git a/.functions/backup_vscode_extensions.sh b/.functions/backup_vscode_extensions.sh
new file mode 100644
index 0000000..727eed0
--- /dev/null
+++ b/.functions/backup_vscode_extensions.sh
@@ -0,0 +1,3 @@
+backup_vscode_extensions() {
+ code --list-extensions > $DOTFILES_DIR/.config/vscode_extensions.txt
+}
\ No newline at end of file
diff --git a/.functions/brew_install.sh b/.functions/brew_install.sh
new file mode 100644
index 0000000..0743434
--- /dev/null
+++ b/.functions/brew_install.sh
@@ -0,0 +1,10 @@
+brew_install() {
+ brew install carthage
+ brew install python
+ brew install rbenv
+ brew install tree
+ brew install watchman
+ brew install zsh-autosuggestions
+ brew install zsh-completions
+ brew install zsh-syntax-highlighting
+}
\ No newline at end of file
diff --git a/.functions/clone_z.sh b/.functions/clone_z.sh
new file mode 100644
index 0000000..81acb00
--- /dev/null
+++ b/.functions/clone_z.sh
@@ -0,0 +1,6 @@
+clone_z() {
+ if [ -d ~/.zrupa ]; then
+ return
+ fi
+ git clone https://github.com/rupa/z ~/.zrupa
+}
\ No newline at end of file
diff --git a/.functions/download_fonts.sh b/.functions/download_fonts.sh
new file mode 100644
index 0000000..bde7c18
--- /dev/null
+++ b/.functions/download_fonts.sh
@@ -0,0 +1,7 @@
+download_fonts() {
+ FONT_PATH="$HOME/Library/Fonts/Meslo LG M Regular for Powerline.ttf"
+ if [ -f "$FONT_PATH" ]; then
+ return
+ fi
+ curl https://raw.githubusercontent.com/powerline/fonts/master/Meslo%20Slashed/Meslo%20LG%20M%20Regular%20for%20Powerline.ttf --output "$FONT_PATH"
+}
\ No newline at end of file
diff --git a/.functions/gem_install.sh b/.functions/gem_install.sh
new file mode 100644
index 0000000..625b93b
--- /dev/null
+++ b/.functions/gem_install.sh
@@ -0,0 +1,7 @@
+gem_install() {
+ echo N | rbenv install $(cat ~/.ruby-version)
+ rbenv local $(cat ~/.ruby-version)
+ gem install cocoapods
+ gem install fastlane
+ gem install xcode-install
+}
\ No newline at end of file
diff --git a/.functions/install_dotfiles.sh b/.functions/install_dotfiles.sh
new file mode 100644
index 0000000..736499e
--- /dev/null
+++ b/.functions/install_dotfiles.sh
@@ -0,0 +1,17 @@
+install_dotfiles() {
+ clone_z
+ download_fonts
+ link_dotfiles
+ install_oh_my_zsh
+ install_homebrew
+ install_rbenv
+ install_nvm
+ source ~/.zshrc
+ brew_install
+ pip3_install && source ~/.zshrc
+ gem_install
+ npm_install
+ sync_brew_cask_list
+ sync_vscode_extensions
+ macos
+}
diff --git a/.functions/install_homebrew.sh b/.functions/install_homebrew.sh
new file mode 100644
index 0000000..bb0d4ef
--- /dev/null
+++ b/.functions/install_homebrew.sh
@@ -0,0 +1,6 @@
+install_homebrew() {
+ if type brew >/dev/null 2>&1; then
+ return
+ fi
+ mkdir ~/.homebrew && curl -L https://github.com/Homebrew/brew/tarball/master | tar xz --strip 1 -C ~/.homebrew
+}
\ No newline at end of file
diff --git a/.functions/install_nvm.sh b/.functions/install_nvm.sh
new file mode 100644
index 0000000..80dda9e
--- /dev/null
+++ b/.functions/install_nvm.sh
@@ -0,0 +1,6 @@
+install_nvm() {
+ if type nvm >/dev/null 2>&1; then
+ return
+ fi
+ curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash
+}
\ No newline at end of file
diff --git a/.functions/install_oh_my_zsh.sh b/.functions/install_oh_my_zsh.sh
new file mode 100644
index 0000000..d9705a6
--- /dev/null
+++ b/.functions/install_oh_my_zsh.sh
@@ -0,0 +1,7 @@
+install_oh_my_zsh() {
+ if [ -d ~/.oh-my-zsh ]; then
+ return
+ fi
+ git clone https://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh
+ sudo chsh -s /bin/zsh "$USER"
+}
\ No newline at end of file
diff --git a/.functions/install_rbenv.sh b/.functions/install_rbenv.sh
new file mode 100644
index 0000000..032332c
--- /dev/null
+++ b/.functions/install_rbenv.sh
@@ -0,0 +1,3 @@
+install_rbenv() {
+ brew install rbenv
+}
\ No newline at end of file
diff --git a/.functions/link_dotfiles.sh b/.functions/link_dotfiles.sh
new file mode 100644
index 0000000..89d8872
--- /dev/null
+++ b/.functions/link_dotfiles.sh
@@ -0,0 +1,14 @@
+link_dotfiles() {
+ link_file .zshrc
+ link_file .vimrc
+ link_file .ruby-version
+ link_file .gemrc
+ link_file .nvmrc
+ link_file .vmdrc
+ link_file .gitignore_global
+ link_file .config/powerline-shell/config.json
+ link_file Library/Application\ Support/Spectacle/Shortcuts.json
+ link_file Library/Application\ Support/Code/User/settings.json
+ link_file Library/Application\ Support/Code/User/keybindings.json
+ link_file Library/Preferences/com.googlecode.iterm2.plist
+}
diff --git a/.functions/link_file.sh b/.functions/link_file.sh
new file mode 100644
index 0000000..8790ca1
--- /dev/null
+++ b/.functions/link_file.sh
@@ -0,0 +1,7 @@
+link_file() {
+ file="$1"
+ srcfile="$DOTFILES_DIR/$file"
+ desfile="$HOME/$file"
+ mkdir -p "$(dirname "$desfile")"
+ ln -f -s "$srcfile" "$desfile"
+}
\ No newline at end of file
diff --git a/.functions/load_android_sdk.sh b/.functions/load_android_sdk.sh
new file mode 100644
index 0000000..0b86d64
--- /dev/null
+++ b/.functions/load_android_sdk.sh
@@ -0,0 +1,12 @@
+load_android_sdk() {
+ export ANDROID_HOME=$HOME/Library/Android/sdk
+ if [ ! -d "$ANDROID_HOME" ]; then
+ unset ANDROID_HOME
+ return
+ fi
+ export PATH=$ANDROID_HOME/tools:$PATH
+ export PATH=$ANDROID_HOME/tools/bin:$PATH
+ export PATH=$ANDROID_HOME/platform-tools:$PATH
+ alias emulator=$ANDROID_HOME/tools/emulator
+}
+load_android_sdk
diff --git a/.functions/load_java.sh b/.functions/load_java.sh
new file mode 100644
index 0000000..4772ea7
--- /dev/null
+++ b/.functions/load_java.sh
@@ -0,0 +1,4 @@
+load_java() {
+ export JAVA_HOME=`/usr/libexec/java_home --request`
+ export PATH=$JAVA_HOME/bin:$PATH
+}
diff --git a/.functions/load_nvm.sh b/.functions/load_nvm.sh
new file mode 100644
index 0000000..b59908c
--- /dev/null
+++ b/.functions/load_nvm.sh
@@ -0,0 +1,8 @@
+load_nvm() {
+ if [ ! -d ~/.nvm ]; then
+ return
+ fi
+ export NVM_DIR="$HOME/.nvm"
+ [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
+ [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
+}
\ No newline at end of file
diff --git a/.functions/load_powerline_shell.sh b/.functions/load_powerline_shell.sh
new file mode 100644
index 0000000..5d0c6c0
--- /dev/null
+++ b/.functions/load_powerline_shell.sh
@@ -0,0 +1,17 @@
+load_powerline_shell() {
+ if ! type powerline-shell >/dev/null 2>&1; then
+ return
+ fi
+ function powerline_precmd() {
+ PS1="$(powerline-shell --shell zsh $?)"
+ }
+ function install_powerline_precmd() {
+ for s in "${precmd_functions[@]}"; do
+ if [ "$s" = "powerline_precmd" ]; then
+ return
+ fi
+ done
+ precmd_functions+=(powerline_precmd)
+ }
+ install_powerline_precmd
+}
\ No newline at end of file
diff --git a/.functions/load_rbenv.sh b/.functions/load_rbenv.sh
new file mode 100644
index 0000000..be983f7
--- /dev/null
+++ b/.functions/load_rbenv.sh
@@ -0,0 +1,6 @@
+load_rbenv() {
+ if ! type rbenv >/dev/null 2>&1; then
+ return
+ fi
+ eval "$(rbenv init -)"
+}
\ No newline at end of file
diff --git a/.functions/load_z.sh b/.functions/load_z.sh
new file mode 100644
index 0000000..cd2ee59
--- /dev/null
+++ b/.functions/load_z.sh
@@ -0,0 +1,3 @@
+load_z() {
+ [ -d ~/.zrupa ] && . ~/.zrupa/z.sh
+}
\ No newline at end of file
diff --git a/.functions/load_zsh_plugins.sh b/.functions/load_zsh_plugins.sh
new file mode 100644
index 0000000..bcb709e
--- /dev/null
+++ b/.functions/load_zsh_plugins.sh
@@ -0,0 +1,10 @@
+function load_zsh_plugins() {
+ if ! type brew >/dev/null 2>&1; then
+ return
+ fi
+ brew_dir=$(brew --prefix)
+ source $brew_dir/share/zsh-autosuggestions/zsh-autosuggestions.zsh
+ source $brew_dir/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
+ fpath=($brew_dir/share/zsh-completions $fpath)
+}
+load_zsh_plugins
\ No newline at end of file
diff --git a/.functions/macos.sh b/.functions/macos.sh
new file mode 100644
index 0000000..fe61e50
--- /dev/null
+++ b/.functions/macos.sh
@@ -0,0 +1,3 @@
+macos() {
+ defaults write com.microsoft.VSCode ApplePressAndHoldEnabled -bool false
+}
\ No newline at end of file
diff --git a/.functions/npm_install.sh b/.functions/npm_install.sh
new file mode 100644
index 0000000..50342b0
--- /dev/null
+++ b/.functions/npm_install.sh
@@ -0,0 +1,6 @@
+npm_install() {
+ nvm install $(cat ~/.nvmrc)
+ nvm alias default $(cat ~/.nvmrc)
+ npm install -g yarn
+ npm install -g vmd
+}
\ No newline at end of file
diff --git a/.functions/pip3_install.sh b/.functions/pip3_install.sh
new file mode 100644
index 0000000..299c38f
--- /dev/null
+++ b/.functions/pip3_install.sh
@@ -0,0 +1,3 @@
+pip3_install() {
+ pip3 install powerline-shell
+}
\ No newline at end of file
diff --git a/.functions/sync_brew_cask_list.sh b/.functions/sync_brew_cask_list.sh
new file mode 100644
index 0000000..af197b2
--- /dev/null
+++ b/.functions/sync_brew_cask_list.sh
@@ -0,0 +1,6 @@
+sync_brew_cask_list() {
+ casks=(`cat $DOTFILES_DIR/.config/brew_cask_list.txt`)
+ for cask in "${casks[@]}"; do
+ brew cask install $cask || brew cask install $cask --force
+ done
+}
\ No newline at end of file
diff --git a/.functions/sync_vscode_extensions.sh b/.functions/sync_vscode_extensions.sh
new file mode 100644
index 0000000..5bba8c6
--- /dev/null
+++ b/.functions/sync_vscode_extensions.sh
@@ -0,0 +1,3 @@
+sync_vscode_extensions() {
+ cat $DOTFILES_DIR/.config/vscode_extensions.txt | xargs -L1 code --install-extension
+}
\ No newline at end of file
diff --git a/.functions/uninstal_rbenv.sh b/.functions/uninstal_rbenv.sh
new file mode 100644
index 0000000..6047b60
--- /dev/null
+++ b/.functions/uninstal_rbenv.sh
@@ -0,0 +1,4 @@
+uninstall_rbenv() {
+ rm -rf `rbenv root`
+ brew uninstall rbenv
+}
\ No newline at end of file
diff --git a/.functions/uninstall_homebrew.sh b/.functions/uninstall_homebrew.sh
new file mode 100644
index 0000000..46884c6
--- /dev/null
+++ b/.functions/uninstall_homebrew.sh
@@ -0,0 +1,4 @@
+uninstall_homebrew() {
+ echo y | ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"
+ for d in /usr/local/*; do sudo rm -rf $d; done
+}
\ No newline at end of file
diff --git a/.functions/uninstall_nvm.sh b/.functions/uninstall_nvm.sh
new file mode 100644
index 0000000..b6c57fe
--- /dev/null
+++ b/.functions/uninstall_nvm.sh
@@ -0,0 +1,3 @@
+uninstall_nvm() {
+ rm -rf ~/.nvm
+}
\ No newline at end of file
diff --git a/.functions/uninstall_rvm.sh b/.functions/uninstall_rvm.sh
new file mode 100644
index 0000000..e32dc9d
--- /dev/null
+++ b/.functions/uninstall_rvm.sh
@@ -0,0 +1,4 @@
+uninstall_rvm() {
+ echo yes | rvm implode
+ rm -rf ~/.rvm
+}
\ No newline at end of file
diff --git a/.functions/upgrade_dotfiles.sh b/.functions/upgrade_dotfiles.sh
new file mode 100644
index 0000000..1d021f3
--- /dev/null
+++ b/.functions/upgrade_dotfiles.sh
@@ -0,0 +1,7 @@
+upgrade_dotfiles() {
+ DOTFILES_DIR=~/.dotfiles
+ if [ -d "$DOTFILES_DIR" ]; then
+ (cd "$DOTFILES_DIR"; git add . && git stash && git pull)
+ fi
+ install_dotfiles
+}
\ No newline at end of file
diff --git a/.gemrc b/.gemrc
index 2bf7755..154cd47 100644
--- a/.gemrc
+++ b/.gemrc
@@ -1 +1 @@
-echo "gem: --no-document"
+gem: --no-document
diff --git a/.nvmrc b/.nvmrc
new file mode 100644
index 0000000..c18c439
--- /dev/null
+++ b/.nvmrc
@@ -0,0 +1 @@
+v8.11.3
\ No newline at end of file
diff --git a/.ruby-version b/.ruby-version
new file mode 100644
index 0000000..35cee72
--- /dev/null
+++ b/.ruby-version
@@ -0,0 +1 @@
+2.4.3
diff --git a/.travis.yml b/.travis.yml
index 1407ff9..38e3a61 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,6 +1,10 @@
-os: osx
+sudo: true
language: objective-c
+os:
+ - osx
install:
- - curl https://raw.githubusercontent.com/blcsntb/mac-setup/master/mac-setup | bash -s all
+ - curl https://raw.githubusercontent.com/blcsntb/mac-setup/dotfiles/dotfiles.sh | bash
+ - source ~/.dotfiles/dotfiles.sh
+ - install_dotfiles
script:
- - ~/mac-setup/mac-setup all
+ - upgrade_dotfiles
diff --git a/.zshrc b/.zshrc
index d1ff949..9b90841 100644
--- a/.zshrc
+++ b/.zshrc
@@ -1,54 +1,20 @@
-ZSH_THEME="robbyrussell"
-
-export ZSH=~/.oh-my-zsh
-
-export LC_ALL=en_US.UTF-8
-export LANG=en_US.UTF-8
-
-export PATH=$HOME/.homebrew/bin:$PATH
-
-export JAVA_HOME=`/usr/libexec/java_home -v 1.8`
-export PATH=$JAVA_HOME/bin:$PATH
-
-export ANDROID_HOME=$HOME/Library/Android/sdk
-export PATH=$ANDROID_HOME/tools:$PATH
-export PATH=$ANDROID_HOME/tools/bin:$PATH
-export PATH=$ANDROID_HOME/platform-tools:$PATH
-
-export NVM_DIR="$HOME/.nvm"
-[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
-[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
-
-export MAC_SETUP_DIR="$HOME/mac-setup"
-
-alias mac='~/mac-setup/mac-setup'
-alias mac-update='mac all && source ~/.zshrc'
-alias emulator=$ANDROID_HOME/tools/emulator
alias showFiles='defaults write com.apple.finder AppleShowAllFiles YES && killall Finder'
alias hideFiles='defaults write com.apple.finder AppleShowAllFiles NO && killall Finder'
alias xcode='open -a Xcode'
-alias stree='open -a SourceTree'
-alias restree='killall Sourcetree && stree'
-alias gff='git flow feature'
+alias sourcetree='open -a SourceTree'
-function powerline_precmd() {
- PS1="$(powerline-shell --shell zsh $?)"
-}
-function install_powerline_precmd() {
- for s in "${precmd_functions[@]}"; do
- if [ "$s" = "powerline_precmd" ]; then
- return
- fi
- done
- precmd_functions+=(powerline_precmd)
-}
-install_powerline_precmd
+ZSH_THEME="robbyrussell"
+export ZSH=~/.oh-my-zsh
+export REACT_EDITOR=code
+export PATH=$HOME/.homebrew/bin:$PATH
+export PATH=/Applications/Visual\ Studio\ Code.app/Contents/Resources/app/bin:$PATH
source $ZSH/oh-my-zsh.sh
-source ~/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh
-source $MAC_SETUP_DIR/vscode/.vscode
-
-# Note the source command must be at the end of ~/.zshrc.
-source ~/.zsh/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
-
-eval "$(rbenv init -)"
+source ~/.dotfiles/dotfiles.sh
+load_zsh_plugins
+load_powerline_shell
+load_z
+load_rbenv
+load_nvm
+load_java
+load_android_sdk
diff --git a/.zshrc.default b/.zshrc.default
new file mode 100644
index 0000000..a43e69a
--- /dev/null
+++ b/.zshrc.default
@@ -0,0 +1,103 @@
+# 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="/Users/blcsntb/.oh-my-zsh"
+
+# Set name of the theme to load --- if set to "random", it will
+# load a random theme each time oh-my-zsh is loaded, in which case,
+# to know which specific one was loaded, run: echo $RANDOM_THEME
+# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
+ZSH_THEME="robbyrussell"
+
+# Set list of themes to pick from when loading at random
+# Setting this variable when ZSH_THEME=random will cause zsh to load
+# a theme from this variable instead of looking in ~/.oh-my-zsh/themes/
+# If set to an empty array, this variable will have no effect.
+# ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "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.
+# You can set one of the optional three formats:
+# "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
+# or set a custom format using the strftime function format specifications,
+# see 'man strftime' for details.
+# 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?
+# Standard 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)
+
+source $ZSH/oh-my-zsh.sh
+source /usr/local/share/zsh-autosuggestions/zsh-autosuggestions.zsh
+source /usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
+fpath=(/usr/local/share/zsh-completions $fpath)
+
+# 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"
+
+# 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"
+
+export NVM_DIR="$HOME/.nvm"
+[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
+[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
+
+# Add RVM to PATH for scripting. Make sure this is the last PATH variable change.
+export PATH="$PATH:$HOME/.rvm/bin"
diff --git a/vscode/keybindings.json b/Library/Application Support/Code/User/keybindings.json
similarity index 100%
rename from vscode/keybindings.json
rename to Library/Application Support/Code/User/keybindings.json
diff --git a/vscode/settings.json b/Library/Application Support/Code/User/settings.json
similarity index 93%
rename from vscode/settings.json
rename to Library/Application Support/Code/User/settings.json
index 4ddb752..29a59a5 100644
--- a/vscode/settings.json
+++ b/Library/Application Support/Code/User/settings.json
@@ -2,6 +2,7 @@
"editor.detectIndentation": false,
"editor.fontSize": 14,
"editor.minimap.enabled": false,
+ "editor.renderFinalNewline": false,
"editor.tabSize": 2,
"editor.wordWrap": "on",
"editor.wrappingIndent": "none",
@@ -13,4 +14,4 @@
"terminal.integrated.fontSize": 14,
"vim.foldfix": true,
"window.zoomLevel": -1,
-}
+}
\ No newline at end of file
diff --git a/spectacle/Shortcuts.json b/Library/Application Support/Spectacle/Shortcuts.json
similarity index 100%
rename from spectacle/Shortcuts.json
rename to Library/Application Support/Spectacle/Shortcuts.json
diff --git a/iterm2/com.googlecode.iterm2.plist b/Library/Preferences/com.googlecode.iterm2.plist
similarity index 98%
rename from iterm2/com.googlecode.iterm2.plist
rename to Library/Preferences/com.googlecode.iterm2.plist
index 66f9e78..98056f8 100644
--- a/iterm2/com.googlecode.iterm2.plist
+++ b/Library/Preferences/com.googlecode.iterm2.plist
@@ -29,7 +29,7 @@
LoadPrefsFromCustomFolder
NSNavLastRootDirectory
- ~/Documents
+ ~/.dotfiles/Library/Preferences
NSNavPanelExpandedSizeForOpenMode
{712, 448}
NSQuotedKeystrokeBinding
@@ -69,11 +69,11 @@
1
NSWindow Frame SharedPreferences
- 569 282 1016 512 0 0 1920 1080
+ 278 209 796 486 0 0 1440 877
NSWindow Frame iTerm Window 0
- 1920 -160 1920 1080 1920 -160 1920 1080
+ 0 0 1440 877 0 0 1440 877
NSWindow Frame iTerm Window 1
- 0 0 1920 1080 0 0 1920 1080
+ 0 0 1440 877 0 0 1440 877
NSWindow Frame iTerm Window 2
268 14 650 527 0 0 1920 1080
New Bookmarks
@@ -857,7 +857,7 @@
PrefsCustomFolder
- ~/mac-setup/iterm2
+ ~/.dotfiles/Library/Preferences
PromptOnQuit
SUEnableAutomaticChecks
@@ -895,6 +895,6 @@
findMode_iTerm
0
iTerm Version
- 3.2.6
+ 3.2.9
diff --git a/README.md b/README.md
index 7ca29ca..06777d7 100644
--- a/README.md
+++ b/README.md
@@ -1,25 +1,23 @@
[](https://travis-ci.org/blcsntb/mac-setup)
-
-
# Getting Started
-## Install
-
-Install the latest Xcode command line tools:
+## Requirement
```
xcode-select --install
```
-Install *mac-setup* using curl
+## Install
```
-curl https://raw.githubusercontent.com/blcsntb/mac-setup/master/mac-setup | bash -s all && source ~/.zshrc
+curl https://raw.githubusercontent.com/blcsntb/mac-setup/dotfiles/dotfiles.sh | bash
+source ~/.dotfiles/dotfiles.sh
+install_dotfiles
```
-## Update
+## Upgrade
```
-mac-update
+upgrade_dotfiles
```
diff --git a/jenkins/jenkins b/bin/jenkins
similarity index 100%
rename from jenkins/jenkins
rename to bin/jenkins
diff --git a/lib b/bin/lib
similarity index 100%
rename from lib
rename to bin/lib
diff --git a/brew/brew b/brew/brew
deleted file mode 100755
index f7b5057..0000000
--- a/brew/brew
+++ /dev/null
@@ -1,19 +0,0 @@
-#!/bin/bash
-
-source ~/mac-setup/lib
-
-export PATH=$HOME/.homebrew/bin:$PATH
-
-install() {
- if not_install brew; then
- mkdir ~/.homebrew && curl -L https://github.com/Homebrew/brew/tarball/master | tar xz --strip 1 -C ~/.homebrew
- fi
- verify brew
-}
-
-uninstall() {
- log_uninstalling brew
- echo y | ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"
-}
-
-$@
diff --git a/dotfiles.sh b/dotfiles.sh
new file mode 100644
index 0000000..fc7141e
--- /dev/null
+++ b/dotfiles.sh
@@ -0,0 +1,9 @@
+export DOTFILES_DIR=~/.dotfiles
+
+if [ ! -d "$DOTFILES_DIR" ]; then
+ git clone -b dotfiles https://github.com/blcsntb/mac-setup "$DOTFILES_DIR"
+fi
+
+for f in $DOTFILES_DIR/.functions/*; do
+ source $f
+done
diff --git a/fonts/fonts b/fonts/fonts
deleted file mode 100755
index b0be82e..0000000
--- a/fonts/fonts
+++ /dev/null
@@ -1,25 +0,0 @@
-#!/bin/bash
-
-source ~/mac-setup/lib
-
-cd ~/Library/Fonts
-
-font_name="Meslo LG M Regular for Powerline.ttf"
-
-install() {
- if [ ! -f "$font_name" ]; then
- log_installing "font $font_name"
- curl https://raw.githubusercontent.com/powerline/fonts/master/Meslo%20Slashed/Meslo%20LG%20M%20Regular%20for%20Powerline.ttf \
- --output "$font_name" \
- --silent
- fi
-}
-
-uninstall() {
- if [ -f "$font_name" ]; then
- log_uninstalling "font $font_name"
- rm "$font_name"
- fi
-}
-
-$@
diff --git a/iterm2.png b/iterm2.png
deleted file mode 100644
index 81157d6..0000000
Binary files a/iterm2.png and /dev/null differ
diff --git a/iterm2/README.md b/iterm2/README.md
deleted file mode 100644
index 2b9b10e..0000000
--- a/iterm2/README.md
+++ /dev/null
@@ -1,6 +0,0 @@
-# General
-
-## Preferences
-
-- [x] Load preferences from a custom folder or URL `~/mac-setup/iterm2`
-- [x] Save changes to folder when iTerm2 quits
diff --git a/mac-setup b/mac-setup
deleted file mode 100755
index 46fdec5..0000000
--- a/mac-setup
+++ /dev/null
@@ -1,152 +0,0 @@
-#!/bin/bash
-
---python() {
- install() {
- if not_install python3; then
- brew install python
- fi
- verify python3
- verify pip3
-
- if not_install powerline-shell; then
- pip3 install powerline-shell
- fi
- verify powerline-shell
- }
- uninstall() {
- log_uninstalling python
- rm -rf ~/Library/Python
- }
- $@
-}
---zsh() {
- install() {
- if [ ! -d ~/.oh-my-zsh ]; then
- log_installing zsh
- sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
- fi
-
- if [ ! -d ~/.zsh/zsh-autosuggestions ]; then
- log_installing 'zsh-autosuggestions'
- git clone https://github.com/zsh-users/zsh-autosuggestions ~/.zsh/zsh-autosuggestions
- fi
-
- if [ ! -d ~/.zsh/zsh-syntax-highlighting ]; then
- log_installing 'zsh-syntax-highlighting'
- git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ~/.zsh/zsh-syntax-highlighting
- echo "source ~/.zsh/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" >> ${ZDOTDIR:-$HOME}/.zshrc
- fi
- }
- uninstall() {
- if [ -d ~/.oh-my-zsh ]; then
- log_uninstalling zsh
- rm -rf ~/.oh-my-zsh
- rm -rf ~/.zsh
- rm ~/.zshrc*
- fi
- }
- $@
-}
---iterm2() {
- install() {
- if [ ! -d /Applications/iTerm.app ]; then
- log_installing iterm2
- brew cask install iterm2
- fi
- }
- $@
-}
-config() {
- vim() {
- rm ~/.vimrc
- ln -s ~/mac-setup/.vimrc ~/.vimrc
- readlink ~/.vimrc
- }
- gitignore_global() {
- rm ~/.gitignore_global
- ln -s ~/mac-setup/.gitignore_global ~/.gitignore_global
- readlink ~/.gitignore_global
- }
- zsh() {
- rm ~/.zshrc
- ln -s ~/mac-setup/.zshrc ~/.zshrc
- readlink ~/.zshrc
- }
- powerline-shell() {
- mkdir -p ~/.config/powerline-shell
- rm ~/.config/powerline-shell/config.json
- ln -s ~/mac-setup/powerline-shell/config.json ~/.config/powerline-shell/config.json
- readlink ~/.config/powerline-shell/config.json
- }
- gem() {
- rm ~/.gemrc
- ln -s ~/mac-setup/.gemrc ~/.gemrc
- readlink ~/.gemrc
- }
- vmd() {
- rm ~/.vmdrc
- ln -s ~/mac-setup/.vmdrc ~/.vmdrc
- readlink ~/.vmdrc
- }
- iterm2() {
- cp ~/mac-setup/iterm2/com.googlecode.iterm2.plist ~/Library/Preferences/com.googlecode.iterm2.plist
- }
- spectacle() {
- mkdir -p ~/Library/Application\ Support/Spectacle
- rm ~/Library/Application\ Support/Spectacle/Shortcuts.json
- ln -s ~/mac-setup/spectacle/Shortcuts.json ~/Library/Application\ Support/Spectacle/Shortcuts.json
- readlink ~/Library/Application\ Support/Spectacle/Shortcuts.json
- }
- vscode() {
- if [ -d ~/Library/Application\ Support/Code/User ]; then
- rm ~/Library/Application\ Support/Code/User/settings.json
- rm ~/Library/Application\ Support/Code/User/keybindings.json
- ln -s ~/mac-setup/vscode/settings.json ~/Library/Application\ Support/Code/User/settings.json
- ln -s ~/mac-setup/vscode/keybindings.json ~/Library/Application\ Support/Code/User/keybindings.json
- readlink ~/Library/Application\ Support/Code/User/*.json
- fi
- }
- vim
- gitignore_global
- zsh
- powerline-shell
- gem
- vmd
- run fonts install
- iterm2
- spectacle
- vscode
-}
-
-clone_or_pull() {
- if [ -d ~/mac-setup ]; then
- (cd ~/mac-setup; git add . && git stash --quiet && git pull)
- else
- git clone https://github.com/blcsntb/mac-setup ~/mac-setup
- fi
-}
-
-run() {
- ~/mac-setup/$1/$@
-}
-
-all() {
- run brew install
- --python install
- run rbenv install
- run nvm install
- if [ ! "$CI" ]; then
- --zsh install
- fi
- --iterm2 install
- config
-}
-
-source ~/mac-setup/lib
-
-if [ "$1" == "all" ]; then
- clone_or_pull
- all
-elif [ ! "$1" == "" ]; then
- run $@
-fi
diff --git a/nvm/nvm b/nvm/nvm
deleted file mode 100755
index cd8f6e1..0000000
--- a/nvm/nvm
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/bin/bash
-
-source ~/mac-setup/lib
-
-load_nvm() {
- if [ -d ~/.nvm ]; then
- export NVM_DIR="$HOME/.nvm"
- [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
- else
- export NVM_DIR=
- fi
-}
-
-load_nvm
-
-install() {
- if [ ! -d ~/.nvm ]; then
- log_installing nvm
- curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash
- load_nvm
- fi
- log_installed $NVM_DIR
-}
-
-uninstall() {
- log_uninstalling nvm
- rm -rf ~/.nvm
-}
-
-$@
\ No newline at end of file
diff --git a/rbenv/rbenv b/rbenv/rbenv
deleted file mode 100755
index e1015fe..0000000
--- a/rbenv/rbenv
+++ /dev/null
@@ -1,32 +0,0 @@
-#!/bin/bash
-
-source ~/mac-setup/lib
-
-eval "$(rbenv init -)"
-
-install() {
- if not_install rbenv; then
- brew install rbenv
- rbenv init
- fi
-
- if [ $(which ruby) == '/usr/bin/ruby' ]; then
- log_installing ruby
- rbenv install 2.3.0
- rbenv local 2.3.0
- fi
- verify ruby
- verify gem
-
- if not_install pod; then
- gem install cocoapods --quiet
- fi
- verify pod
-
- if not_install fastlane; then
- gem install fastlane -NV --quiet
- fi
- verify fastlane
-}
-
-$@
diff --git a/vscode/.vscode b/vscode/.vscode
deleted file mode 100644
index a33fd54..0000000
--- a/vscode/.vscode
+++ /dev/null
@@ -1,5 +0,0 @@
-export PATH=/Applications/Visual\ Studio\ Code.app/Contents/Resources/app/bin:$PATH
-export REACT_EDITOR=code
-
-alias vscode='code'
-alias revscode='pgrep Electron | xargs kill && code'