From 40387c7c59b546aa33114213c679121d48aac5eb Mon Sep 17 00:00:00 2001 From: Bert Peters Date: Mon, 23 May 2016 11:58:18 +0200 Subject: [PATCH] Rewrite configuration to be stowed. --- .gitmodules | 22 +++++++++---------- install.sh | 27 +++++++++++++++--------- vim/{ => .vim}/after/ftplugin/php.vim | 0 vim/{ => .vim}/after/ftplugin/smarty.vim | 0 vim/{ => .vim}/autoload/pathogen.vim | 0 vim/{ => .vim}/bundle/indentLine | 0 vim/{ => .vim}/bundle/molokai | 0 vim/{ => .vim}/bundle/shebang | 0 vim/{ => .vim}/bundle/syntastic | 0 vim/{ => .vim}/bundle/vim-javascript | 0 vim/{ => .vim}/bundle/vim-latex | 0 vim/{ => .vim}/bundle/vim-less | 0 vim/{ => .vim}/bundle/vim-markdown | 0 vim/{ => .vim}/bundle/vim-vimlint | 0 vim/{ => .vim}/bundle/vim-vimlparser | 0 vim/{ => .vim}/pathogen | 0 vim/{vimrc => .vimrc} | 0 zshrc => zsh/.zshrc | 0 18 files changed, 28 insertions(+), 21 deletions(-) rename vim/{ => .vim}/after/ftplugin/php.vim (100%) rename vim/{ => .vim}/after/ftplugin/smarty.vim (100%) rename vim/{ => .vim}/autoload/pathogen.vim (100%) rename vim/{ => .vim}/bundle/indentLine (100%) rename vim/{ => .vim}/bundle/molokai (100%) rename vim/{ => .vim}/bundle/shebang (100%) rename vim/{ => .vim}/bundle/syntastic (100%) rename vim/{ => .vim}/bundle/vim-javascript (100%) rename vim/{ => .vim}/bundle/vim-latex (100%) rename vim/{ => .vim}/bundle/vim-less (100%) rename vim/{ => .vim}/bundle/vim-markdown (100%) rename vim/{ => .vim}/bundle/vim-vimlint (100%) rename vim/{ => .vim}/bundle/vim-vimlparser (100%) rename vim/{ => .vim}/pathogen (100%) rename vim/{vimrc => .vimrc} (100%) rename zshrc => zsh/.zshrc (100%) diff --git a/.gitmodules b/.gitmodules index 697148d..1e3a4f6 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,33 +1,33 @@ [submodule "vim/pathogen"] - path = vim/pathogen + path = vim/.vim/pathogen url = https://github.com/tpope/vim-pathogen [submodule "vim/bundle/molokai"] - path = vim/bundle/molokai + path = vim/.vim/bundle/molokai url = https://github.com/tomasr/molokai [submodule "vim/bundle/vim-markdown"] - path = vim/bundle/vim-markdown + path = vim/.vim/bundle/vim-markdown url = https://github.com/tpope/vim-markdown [submodule "vim/bundle/vim-less"] - path = vim/bundle/vim-less + path = vim/.vim/bundle/vim-less url = https://github.com/lunaru/vim-less [submodule "vim/bundle/syntastic"] - path = vim/bundle/syntastic + path = vim/.vim/bundle/syntastic url = https://github.com/scrooloose/syntastic.git [submodule "vim/bundle/vim-javascript"] - path = vim/bundle/vim-javascript + path = vim/.vim/bundle/vim-javascript url = https://github.com/pangloss/vim-javascript [submodule "vim/bundle/vim-vimlint"] - path = vim/bundle/vim-vimlint + path = vim/.vim/bundle/vim-vimlint url = https://github.com/syngan/vim-vimlint [submodule "vim/bundle/vim-vimlparser"] - path = vim/bundle/vim-vimlparser + path = vim/.vim/bundle/vim-vimlparser url = https://github.com/ynkdir/vim-vimlparser [submodule "vim/bundle/vim-latex"] - path = vim/bundle/vim-latex + path = vim/.vim/bundle/vim-latex url = git@github.com:lervag/vim-latex.git [submodule "vim/bundle/shebang"] - path = vim/bundle/shebang + path = vim/.vim/bundle/shebang url = https://github.com/vim-scripts/Shebang [submodule "vim/bundle/indentLine"] - path = vim/bundle/indentLine + path = vim/.vim/bundle/indentLine url = https://github.com/Yggdroot/indentLine diff --git a/install.sh b/install.sh index eb4d61a..6fe87c1 100755 --- a/install.sh +++ b/install.sh @@ -2,6 +2,10 @@ DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) +commandAvailable() { + command -v $1 >/dev/null +} + confirm () { # call with a prompt string or use a default read -r -p "${1:-Are you sure? [y/N]} " response @@ -34,21 +38,24 @@ git submodule init &> /dev/null && git submodule update &> /dev/null \ echo "done." +if ! commandAvailable stow; then + echo "Error: stow not available. Skipping installation." >&2; + exit 1; +fi + # Install vim -echo "Installing vim." - -confirmAndLink $DIR/vim/vimrc $HOME/.vimrc -confirmAndLink $DIR/vim $HOME/.vim - +if commandAvailable vim +then + echo "Installing configuration files for vim."; + stow -t $HOME vim +fi # Install zsh, if relevant. -if which zsh +if commandAvailable zsh then - echo "Installing zsh" - - confirmAndLink $DIR/zshrc $HOME/.zshrc - + echo "Installing configuration files for zsh." + stow -t $HOME zsh fi echo "Installation finished." diff --git a/vim/after/ftplugin/php.vim b/vim/.vim/after/ftplugin/php.vim similarity index 100% rename from vim/after/ftplugin/php.vim rename to vim/.vim/after/ftplugin/php.vim diff --git a/vim/after/ftplugin/smarty.vim b/vim/.vim/after/ftplugin/smarty.vim similarity index 100% rename from vim/after/ftplugin/smarty.vim rename to vim/.vim/after/ftplugin/smarty.vim diff --git a/vim/autoload/pathogen.vim b/vim/.vim/autoload/pathogen.vim similarity index 100% rename from vim/autoload/pathogen.vim rename to vim/.vim/autoload/pathogen.vim diff --git a/vim/bundle/indentLine b/vim/.vim/bundle/indentLine similarity index 100% rename from vim/bundle/indentLine rename to vim/.vim/bundle/indentLine diff --git a/vim/bundle/molokai b/vim/.vim/bundle/molokai similarity index 100% rename from vim/bundle/molokai rename to vim/.vim/bundle/molokai diff --git a/vim/bundle/shebang b/vim/.vim/bundle/shebang similarity index 100% rename from vim/bundle/shebang rename to vim/.vim/bundle/shebang diff --git a/vim/bundle/syntastic b/vim/.vim/bundle/syntastic similarity index 100% rename from vim/bundle/syntastic rename to vim/.vim/bundle/syntastic diff --git a/vim/bundle/vim-javascript b/vim/.vim/bundle/vim-javascript similarity index 100% rename from vim/bundle/vim-javascript rename to vim/.vim/bundle/vim-javascript diff --git a/vim/bundle/vim-latex b/vim/.vim/bundle/vim-latex similarity index 100% rename from vim/bundle/vim-latex rename to vim/.vim/bundle/vim-latex diff --git a/vim/bundle/vim-less b/vim/.vim/bundle/vim-less similarity index 100% rename from vim/bundle/vim-less rename to vim/.vim/bundle/vim-less diff --git a/vim/bundle/vim-markdown b/vim/.vim/bundle/vim-markdown similarity index 100% rename from vim/bundle/vim-markdown rename to vim/.vim/bundle/vim-markdown diff --git a/vim/bundle/vim-vimlint b/vim/.vim/bundle/vim-vimlint similarity index 100% rename from vim/bundle/vim-vimlint rename to vim/.vim/bundle/vim-vimlint diff --git a/vim/bundle/vim-vimlparser b/vim/.vim/bundle/vim-vimlparser similarity index 100% rename from vim/bundle/vim-vimlparser rename to vim/.vim/bundle/vim-vimlparser diff --git a/vim/pathogen b/vim/.vim/pathogen similarity index 100% rename from vim/pathogen rename to vim/.vim/pathogen diff --git a/vim/vimrc b/vim/.vimrc similarity index 100% rename from vim/vimrc rename to vim/.vimrc diff --git a/zshrc b/zsh/.zshrc similarity index 100% rename from zshrc rename to zsh/.zshrc