Skip to content

Commit

Permalink
vim stuffs
Browse files Browse the repository at this point in the history
  • Loading branch information
stvkoch committed Mar 25, 2014
2 parents 520672d + f0a803d commit bdeb9d4
Show file tree
Hide file tree
Showing 6 changed files with 142 additions and 15 deletions.
6 changes: 3 additions & 3 deletions bin/e
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
# $ e /usr/local
# # => opens the specified directory in your editor

if test "$1" == ""
if [ -n $1 ]
then
exec $EDITOR .
exec $EDITOR . &
else
exec $EDITOR "$1"
exec $EDITOR "$1" &
fi
1 change: 1 addition & 0 deletions cache/DEBS_avail

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions sapo/aliases.zsh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
alias stv='synergyc --daemon --restart stvkoch.sl.pt'
143 changes: 133 additions & 10 deletions script/bootstrap
Original file line number Diff line number Diff line change
@@ -1,16 +1,139 @@
#!/bin/sh
#!/usr/bin/env bash
#
# bootstrap installs things.

unamestr=`uname`
DOTFILES_ROOT="`pwd`"

if [ "$unamestr" = Linux ]; then
. ~/.dotfiles/script/apt-get
else
. ~/.dotfiles/script/homebrew
fi
set -e

echo ''


# echo "#### Install $ZSH ####"
# # Run the install (I'd like to pull this out of rake, eventually)
# rake install -f ../Rakefile --trace

info () {
printf " [ \033[00;34m..\033[0m ] $1"
}

user () {
printf "\r [ \033[0;33m?\033[0m ] $1 "
}

success () {
printf "\r\033[2K [ \033[00;32mOK\033[0m ] $1\n"
}

fail () {
printf "\r\033[2K [\033[0;31mFAIL\033[0m] $1\n"
echo ''
exit
}

setup_gitconfig () {
if ! [ -f git/gitconfig.symlink ]
then
info 'setup gitconfig'

user ' - What is your github author name?'
read -e git_authorname
user ' - What is your github author email?'
read -e git_authoremail

sed -e "s/AUTHORNAME/$git_authorname/g" -e "s/AUTHOREMAIL/$git_authoremail/g" git/gitconfig.symlink.example > git/gitconfig.symlink

success 'gitconfig'
fi
}

link_files () {
ln -s $1 $2
success "linked $1 to $2"
}

install_dotfiles () {
info 'installing dotfiles'

overwrite_all=false
backup_all=false
skip_all=false

for source in `find $DOTFILES_ROOT -maxdepth 2 -name \*.symlink`
do
dest="$HOME/.`basename \"${source%.*}\"`"

if [ -f $dest ] || [ -d $dest ]
then

overwrite=false
backup=false
skip=false

if [ "$overwrite_all" == "false" ] && [ "$backup_all" == "false" ] && [ "$skip_all" == "false" ]
then
user "File already exists: `basename $source`, what do you want to do? [s]kip, [S]kip all, [o]verwrite, [O]verwrite all, [b]ackup, [B]ackup all?"
read -n 1 action

case "$action" in
o )
overwrite=true;;
O )
overwrite_all=true;;
b )
backup=true;;
B )
backup_all=true;;
s )
skip=true;;
S )
skip_all=true;;
* )
;;
esac
fi

if [ "$overwrite" == "true" ] || [ "$overwrite_all" == "true" ]
then
rm -rf $dest
success "removed $dest"
fi

if [ "$backup" == "true" ] || [ "$backup_all" == "true" ]
then
mv $dest $dest\.backup
success "moved $dest to $dest.backup"
fi

if [ "$skip" == "false" ] && [ "$skip_all" == "false" ]
then
link_files $source $dest
else
success "skipped $source"
fi

else
link_files $source $dest
fi

done
}

setup_gitconfig
install_dotfiles

# If we are on a mac, lets install and setup homebrew
if [ "$(uname -s)" == "Darwin" ]
then
info "installing dependencies"
if . bin/dot > /tmp/dotfiles-dot 2>&1
then
success "dependencies installed"
else
fail "error installing dependencies"
fi
fi

echo ''
echo ' All installed!'

echo "#### Install $ZSH ####"
# Run the install (I'd like to pull this out of rake, eventually)
rake install -f ../Rakefile --trace
2 changes: 1 addition & 1 deletion system/env.zsh
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export EDITOR='subl'
export EDITOR='sublime'
4 changes: 3 additions & 1 deletion zsh/zshrc.symlink
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ for config_file ($ZSH/**/*.zsh) source $config_file
#fi


[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*


# initialize autocomplete here, otherwise functions won't be loaded
#autoload -U #compinit
Expand All @@ -26,4 +28,4 @@ for config_file ($ZSH/**/*.zsh) source $config_file
for config_file ($ZSH/**/completion.zsh) source $config_file

echo "Tip for this terminal:"
random_man_name
random_man_name

0 comments on commit bdeb9d4

Please sign in to comment.