summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorKjetil Orbekk <kjetil.orbekk@gmail.com>2015-06-09 21:56:36 -0400
committerKjetil Orbekk <kjetil.orbekk@gmail.com>2015-06-09 21:56:36 -0400
commit078dc1f71c05dac608bd8c3770138a3fa6b78e40 (patch)
treeb3312a4c00509d1c8915ce39b03afde2fe402b37 /bin
parent4aebf9589bbf664d80201956c96ce0b6d1f289dc (diff)
Add vim and i3 configs.
Diffstat (limited to 'bin')
-rwxr-xr-xbin/setup.sh44
1 files changed, 41 insertions, 3 deletions
diff --git a/bin/setup.sh b/bin/setup.sh
index 16ced8c..4921bcf 100755
--- a/bin/setup.sh
+++ b/bin/setup.sh
@@ -1,6 +1,7 @@
#!/bin/bash
red='\e[0;31m'
+orange='\e[0;33m'
green='\e[0;32m'
none='\e[0m'
@@ -15,15 +16,52 @@ fi
# Does nothing and prints an error message if $2 exists and is not a symlink.
create_symlink() {
if [[ -e "$2" && ! -h "$2" ]]; then
- echo -e "${red}[WARNING]${none} '$2' exists and is not a symlink. Skipped."
+ echo -e "${orange}[SKIPPED]${none} '$2' exists and is not a symlink."
+ return
else
if ln -sf "$1" "$2"; then
echo -e "${green}[OK]${none} '$2' → '$1'"
else
- echo -e "${red}[WARNING] Could not create '$2'"
+ echo -e "${red}[WARNING]${none} could not create '$2'"
fi
fi
+ if ! diff "$2" "$(dirname $2)/$1"; then
+ echo -e "${red}[WARNING]${none} diffs in $2"
+ fi
}
create_symlink dotfiles/gitconfig .gitconfig
-create_symlink dotfiles/zshrc .zshrc
+create_symlink /dev/null .vimrc.local
+
+if [[ "${SHELL}" = *zsh* ]]; then
+ create_symlink dotfiles/zshrc .zshrc
+else
+ echo -e "${orange}[SKIPPED]${none} shell is not zsh :-(."
+fi
+
+if which i3 >/dev/null; then
+ mkdir -p .i3
+ create_symlink ../dotfiles/i3/config .i3/config
+else
+ echo -e "${orange}[SKIPPED]${none} i3 not installed."
+fi
+
+create_symlink dotfiles/vimrc .vimrc
+if which git >/dev/null; then
+ if [[ -e .vim/bundle/Vundle.vim ]]; then
+ echo -e "${orange}[SKIPPED]${none} Vundle.vim already installed"
+ else
+ success=1
+ mkdir -p .vim/bundle
+ git clone https://github.com/gmarik/Vundle.vim.git ~/.vim/bundle/Vundle.vim \
+ || success=0
+ vim +PluginInstall +qall || success=0
+ if [[ "$success" == "1" ]]; then
+ echo -e "${green}[OK]${none} installed vim plugins"
+ else
+ echo -e "${red}[WARNING]${none} failed to install vim plugins"
+ fi
+ fi
+else
+ echo -e "${red}[WARNING]${none} git not installed"
+fi