@@ -17,21 +17,33 @@ from time import sleep
1717 HOME = expanduser("~")
1818 PWD = dirname(__file__)
1919
20+VIMRC = join(HOME, ".vimrc")
21+VIM = join(HOME, ".vim")
22+ZSHRC = join(HOME, ".zshrc")
23+ZSH = join(HOME, ".oh-my-zsh")
24+
2025
2126 def clean():
2227 """ This rests everything """
2328
24- remove(join(HOME, ".vimrc"))
25- remove(join(HOME, ".zshrc"))
26- rmtree(join(HOME, ".vim"))
27- rmtree(join(HOME, ".oh-my-zsh"))
29+ if exists(VIMRC):
30+ remove(VIMRC)
31+
32+ if exists(VIM):
33+ rmtree(VIM)
34+
35+ if exists(ZSHRC):
36+ remove(ZSHRC)
37+
38+ if exists(ZSH):
39+ rmtree(ZSH)
2840
2941
3042 def create_vim_bundle():
3143 """ Create necessary folders: .vim/bundle """
3244
33- bundle = join(HOME, ".vim/bundle")
34- autoload = join(HOME, ".vim/autoload")
45+ bundle = join(VIM, "bundle")
46+ autoload = join(VIM, "autoload")
3547
3648 if not exists(bundle):
3749 makedirs(bundle)
@@ -67,32 +79,25 @@ def clone_plugins():
6779 def setup_vim():
6880 """ copy the vim file """
6981
70- vimrc = join(HOME, ".vimrc");
71-
72- if not exists(vimrc):
73- copyfile(join(PWD, "vimrc"), vimrc)
82+ if not exists(VIMRC):
83+ copyfile(join(PWD, "vimrc"), VIMRC)
7484
7585
7686 def install_ohmyzsh():
7787 """ installs oh-my-zsh """
7888
79- ohmyzsh_folder = join(HOME, ".oh-my-zsh")
80- zshrc_file = join(HOME, ".zshrc")
81- install_script = join(PWD, "ohmyzsh_install.sh")
82-
83- print "Script: %s" % install_script
89+ call(["git", "clone", "https://github.com/robbyrussell/oh-my-zsh.git", ZSH])
90+ copyfile(join(PWD, "zshrc"), ZSHRC)
91+ print "Don't forget to set your SHELL: chsh -s /bin/zsh"
8492
85- call(["curl", "-L", "http://install.ohmyz.sh", "-o", install_script])
86- call(["sh", install_script])
8793
8894
8995 def setup_zsh():
9096 """ moves the file into the correct place """
9197
92- zshrc = join(HOME, ".zshrc")
9398 theme_folder = join(HOME, ".oh-my-zsh/custom/themes")
9499
95- copyfile(join(PWD, "zshrc"), zshrc)
100+ copyfile(join(PWD, "zshrc"), ZSHRC)
96101
97102 if not exists(theme_folder):
98103 makedirs(theme_folder)
@@ -100,19 +105,19 @@ def setup_zsh():
100105
101106
102107 def main():
103- #clean()
108+ clean()
104109
105110 # vim
106- #create_vim_bundle()
107- #install_pathogen()
108- #clone_plugins()
109- #setup_vim()
111+ create_vim_bundle()
112+ install_pathogen()
113+ clone_plugins()
114+ setup_vim()
110115
111116 # zsh
112117 install_ohmyzsh()
113118 setup_zsh()
114119
115- print "done."
120+ print "Done, your changes will be visible when the terminal resets."
116121
117122
118123 if __name__ == "__main__":