Beispiel #1
0
def zsh():
    if not program_exists('zsh'):
        ensure_package('zsh')
    ensure_git_repo('~/.oh-my-zsh', 'git://github.com/yejianye/oh-my-zsh.git', pushurl='[email protected]:yejianye/oh-my-zsh.git')
    ensure_link('.zshrc_common', 'configs/.zshrc_common')
    ensure_file('.zshrc', append='source ~/.zshrc_common')
    ensure_file('.zshenv', append=['setopt ALL_EXPORT'])
    ensure_dir('~/bin')
    ensure_git_repo('~/utils', 'git://github.com/yejianye/util-scripts.git', pushurl='[email protected]:yejianye/util-scripts.git')
    ensure_bin_path(['.', '~/bin', '~/utils', '/usr/local/bin'])
Beispiel #2
0
def ensure_git_repo(path, url, pushurl=None, submodules=False):
	if not exists(path):
		if not program_exists('git'):
			ensure_package('git')
		run('git clone %s %s' % (url, path))
		if pushurl:
			with(cd(path)):
				run('git config remote.origin.pushurl %s' % pushurl)
		if submodules:
			with(cd(path)):
				run('git submodule init')
				run('git submodule update')
Beispiel #3
0
def tmux():
    ensure_package('tmux')
    ensure_link('.tmux.conf', 'configs/.tmux.conf')
    if is_macos():
        if not program_exists('reattach-to-user-namespace'):
            ensure_git_repo('/tmp/reattach-to-user-namespace', 'git://github.com/ChrisJohnsen/tmux-MacOSX-pasteboard.git')
            with cd('/tmp/reattach-to-user-namespace'):
                run('make reattach-to-user-namespace')
                run('cp reattach-to-user-namespace ~/bin')
        ensure_link('.tmux.platform.conf', 'configs/.tmux.mac.conf')
    else:
        ensure_file('.tmux.platform.conf')
    ensure_ruby_pkg('tmuxinator')
Beispiel #4
0
def vim():
    # get vim version
    ensure_git_repo('.vim', 'git://github.com/yejianye/vim-setup.git', pushurl='[email protected]:yejianye/vim-setup.git', submodules=True)
    ensure_link('.vimrc_common', '~/.vim/.vimrc_common')
    ensure_file('.vimrc', append='source ~/.vimrc_common')
    # With Mac gcc and make should be installed with Xcode
    if not is_macos():
        ensure_package('gcc')
        ensure_package('make')
    with(cd('~/.vim/bundle/vimproc')):
        if is_macos():
            run('make -f make_mac.mak')
        elif is_linux():
            run('make -f make_unix.mak')
    # setup pushurl for submodules
    with(cd('~/.vim/bundle/textobj_function')):    
        run('git config remote.origin.pushurl [email protected]:yejianye/vim-textobj-function.git')
    with(cd('~/.vim/bundle/vim-ref-jquery')):
        run('git config remote.origin.pushurl [email protected]:yejianye/vim-ref-jquery.git')
    with(cd('~/.vim/bundle/syntastic')):
        run('git config remote.origin.pushurl [email protected]:yejianye/syntastic.git')
Beispiel #5
0
def install_vim73():
    ensure_package('gcc')
    ensure_package('libncurses5-dev')
    if not exists('/tmp/vim73'):
        ensure_package('wget')
        with(cd('/tmp')):
            run('wget -q -O - ftp://ftp.vim.org/pub/vim/unix/vim-7.3.tar.bz2 | tar jx')
    with(cd('/tmp/vim73')):
        run('./configure --enable-pythoninterp --enable-rubyinterp --enable-cscope')
        run('make')
        sudo('make install')
Beispiel #6
0
def ctags():
    if is_macos():
        ensure_package('ctags', '--HEAD')  # Ensure to get Ctags trunk for Objective-C support
    else:
        ensure_package('ctags')
    ensure_link('.ctags', 'configs/.ctags')
Beispiel #7
0
def screen():
    ensure_package('screen')
    ensure_link('.screenrc', 'configs/.screenrc')