xonecas.io
2780
D2

dotfiles-2014 / commit a8e4f9d

new install script, only installs, no update yet...

sean2014-10-13 a8e4f9d1f23a769b0ab4f04e776bc0c37540b3d5

5 files changed

install.py+105−0
@@ -0,0 +1,105 @@
1+#!/usr/bin/env python
2+
3+from os import makedirs
4+from os.path import basename
5+from os.path import dirname
6+from os.path import exists
7+from os.path import expanduser
8+from os.path import join
9+from os.path import splitext
10+from shutil import copyfile
11+from subprocess import call
12+
13+
14+HOME = expanduser("~")
15+PWD = dirname(__file__)
16+
17+
18+def create_vim_bundle():
19+ """ Create necessary folders: .vim/bundle """
20+
21+ bundle = join(HOME, ".vim/bundle")
22+ autoload = join(HOME, ".vim/autoload")
23+
24+ if not exists(bundle):
25+ makedirs(bundle)
26+
27+ if not exists(autoload):
28+ makedirs(autoload)
29+
30+
31+def install_pathogen():
32+ """ get and install the latest pathogen """
33+
34+ autoload = join(HOME, ".vim/autoload/pathogen.vim")
35+
36+ if not exists(autoload):
37+ call(["curl", "-L", "https://tpo.pe/pathogen.vim", "-o", autoload])
38+
39+
40+def clone_plugins():
41+ """ read from the list and clone each one """
42+
43+ plugin_list = join(PWD, "vim_plugins.txt")
44+ bundle = join(HOME, ".vim/bundle")
45+
46+ with open(plugin_list) as f:
47+ plugins_list = f.readlines()
48+
49+ for plugin_url in plugins_list:
50+ foldername = splitext(basename(plugin_url))[0]
51+ print join(bundle, foldername)
52+ call(["git", "clone", plugin_url, join(bundle, foldername)])
53+
54+
55+def setup_vim():
56+ """ copy the vim file """
57+
58+ vimrc = join(HOME, ".vimrc");
59+
60+ if not exists(vimrc):
61+ copyfile(join(PWD, "vimrc"), vimrc)
62+
63+
64+def install_ohmyzsh():
65+ """ installs oh-my-zsh """
66+
67+ ohmyzsh_folder = join(HOME, ".oh-my-zsh")
68+ zshrc_file = join(HOME, ".zshrc")
69+ install_script = join(PWD, "ohmyzsh_install.sh")
70+
71+ if exists(ohmyzsh_folder) and exists(zshrc_file):
72+ print "Looks installed, won't forcefully re-install"
73+ return
74+
75+ call(["curl", "-L", "http://install.ohmyz.sh", "-o", install_script])
76+ call(["sh", install_script])
77+
78+
79+def setup_zsh():
80+ """ moves the file into the correct place """
81+
82+ zshrc = join(HOME, ".zshrc")
83+ theme = join(HOME, ".oh-my-zsh/custom/themes/xonecas.zsh-theme")
84+
85+ if not exists(zshrc):
86+ copyfile(join(PWD, "zshrc"), zshrc)
87+
88+ if not exists(theme):
89+ copyfile(join(PWD, "xonecas.zsh-theme"), join(theme))
90+
91+
92+def main():
93+ # vim
94+ create_vim_bundle()
95+ install_pathogen()
96+ clone_plugins()
97+ setup_vim()
98+
99+ # zsh
100+ install_ohmyzsh()
101+ setup_zsh()
102+
103+
104+if __name__ == "__main__":
105+ main()
vim_plugins.txt+8−0
@@ -0,0 +1,8 @@
1+https://github.com/scrooloose/nerdcommenter.git
2+https://github.com/scrooloose/syntastic.git
3+https://github.com/bling/vim-airline.git
4+https://github.com/bling/vim-bufferline.git
5+https://github.com/tpope/vim-haml.git
6+https://github.com/kchmck/vim-coffee-script.git
7+https://github.com/hynek/vim-python-pep8-indent
8+https://github.com/whatyouhide/vim-gotham.git
vimrc+48−0
@@ -0,0 +1,48 @@
1+execute pathogen#infect()
2+syntax on
3+filetype plugin indent on
4+
5+set relativenumber
6+set nocompatible
7+set encoding=utf-8
8+set ruler
9+set colorcolumn=100
10+set incsearch
11+set smartcase
12+set smartindent
13+set cinkeys-=0#
14+set hlsearch
15+set linebreak
16+set autoindent
17+set expandtab
18+set smarttab
19+set tabstop=4
20+set shiftwidth=4
21+set pastetoggle=<F2>
22+set noswapfile
23+set nobackup
24+set autoread
25+set hidden
26+set wildmenu
27+set wildmode=list:longest,full
28+set wildignore=*.class,*.o,*~,*.pyc,.git,third_party,node_modules
29+set laststatus=2
30+set list
31+set listchars=tab:▸\ ,trail:•,eol:¬
32+
33+map <leader>] :bnext<CR>
34+map <leader>[ :bprev<CR>
35+nmap <leader>e :e#<CR>
36+map <leader>b :buffers<CR>
37+map <leader>x :bdelete<CR>
38+nmap <leader>h :nohlsearch<CR>
39+map j gj
40+map k gk
41+
42+command! Q q
43+command! W w
44+
45+set t_Co=256
46+set t_ut=
47+colorscheme gotham256
48+let g:airline_powerline_fonts=1
xonecas.zsh-theme+26−0
@@ -0,0 +1,26 @@
1+# This theme depends on unicode and 256 colors.
2+# user@hostname ~/my/dir [git √|✗][venv]
3+
4+autoload -U add-zsh-hook
5+
6+xonecas_prompt () {
7+ USERNAME="%n"
8+ AT="%{$FG[009]%}@%{$FG[007]%}"
9+ HOSTNAME="%m"
10+ WORKING_DIR="%{$FG[008]%}%~"
11+
12+ ZSH_THEME_GIT_PROMPT_PREFIX="%{$FG[004]%}[%{$FG[007]%}"
13+ ZSH_THEME_GIT_PROMPT_SUFFIX="%{$FG[004]%}]%{$FG[007]%} "
14+ ZSH_THEME_GIT_PROMPT_DIRTY=" %{$FG[009]%}✗%{$FG[007]%}"
15+ ZSH_THEME_GIT_PROMPT_CLEAN=" %{$FG[010]%}√%{$FG[007]%}"
16+ GIT="$(git_prompt_info)"
17+
18+ function virtualenv_info {
19+ [ ! -z "$VIRTUAL_ENV" ] && \
20+ echo "$ZSH_THEME_GIT_PROMPT_PREFIX$(basename $VIRTUAL_ENV)$ZSH_THEME_GIT_PROMPT_SUFFIX"
21+ }
22+
23+ PROMPT="$USERNAME$AT$HOSTNAME $WORKING_DIR $GIT$(virtualenv_info)$ %{$reset_color%}"
24+}
25+
26+add-zsh-hook precmd xonecas_prompt
zshrc+62−0
@@ -0,0 +1,62 @@
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="xonecas"
9+
10+# Example aliases
11+# alias zshconfig="mate ~/.zshrc"
12+# alias ohmyzsh="mate ~/.oh-my-zsh"
13+alias tmux='tmux -2'
14+
15+# Set to this to use case-sensitive completion
16+# CASE_SENSITIVE="true"
17+
18+# Comment this out to disable bi-weekly auto-update checks
19+# DISABLE_AUTO_UPDATE="true"
20+
21+# Uncomment to change how often before auto-updates occur? (in days)
22+# export UPDATE_ZSH_DAYS=13
23+
24+# Uncomment following line if you want to disable colors in ls
25+# DISABLE_LS_COLORS="true"
26+
27+# Uncomment following line if you want to disable autosetting terminal title.
28+# DISABLE_AUTO_TITLE="true"
29+
30+# Uncomment following line if you want to disable command autocorrection
31+# DISABLE_CORRECTION="true"
32+
33+# Uncomment following line if you want red dots to be displayed while waiting for completion
34+# COMPLETION_WAITING_DOTS="true"
35+
36+# Uncomment following line if you want to disable marking untracked files under
37+# VCS as dirty. This makes repository status check for large repositories much,
38+# much faster.
39+# DISABLE_UNTRACKED_FILES_DIRTY="true"
40+
41+# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
42+# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
43+# Example format: plugins=(rails git textmate ruby lighthouse)
44+plugins=(git)
45+
46+source $ZSH/oh-my-zsh.sh
47+
48+# Customize to your needs...
49+SSHAGENT=/usr/bin/ssh-agent
50+SSHAGENTARGS="-s"
51+if [ -z "$SSH_AUTH_SOCK" -a -x "$SSHAGENT" ]; then
52+ eval `$SSHAGENT $SSHAGENTARGS`
53+ trap "kill $SSH_AGENT_PID" 0
54+fi
55+
56+export EDITOR=vim VISUAL=vim
57+export PATH=/opt/bin:$PATH
58+
59+# make sure all terminals are the same.
60+export TERM=xterm-256color
61+
62+PATH=$HOME/bin:$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting