mirror of
https://github.com/bertptrs/vimconfig.git
synced 2025-12-25 20:40:32 +01:00
Move vim files to a seperate directory
This commit is contained in:
36
.gitmodules
vendored
36
.gitmodules
vendored
@@ -1,27 +1,27 @@
|
|||||||
[submodule "pathogen"]
|
[submodule "vim/pathogen"]
|
||||||
path = pathogen
|
path = vim/pathogen
|
||||||
url = https://github.com/tpope/vim-pathogen
|
url = https://github.com/tpope/vim-pathogen
|
||||||
[submodule "bundle/molokai"]
|
[submodule "vim/bundle/molokai"]
|
||||||
path = bundle/molokai
|
path = vim/bundle/molokai
|
||||||
url = https://github.com/tomasr/molokai
|
url = https://github.com/tomasr/molokai
|
||||||
[submodule "bundle/vim-markdown"]
|
[submodule "vim/bundle/vim-markdown"]
|
||||||
path = bundle/vim-markdown
|
path = vim/bundle/vim-markdown
|
||||||
url = https://github.com/tpope/vim-markdown
|
url = https://github.com/tpope/vim-markdown
|
||||||
[submodule "bundle/vim-less"]
|
[submodule "vim/bundle/vim-less"]
|
||||||
path = bundle/vim-less
|
path = vim/bundle/vim-less
|
||||||
url = https://github.com/lunaru/vim-less
|
url = https://github.com/lunaru/vim-less
|
||||||
[submodule "bundle/syntastic"]
|
[submodule "vim/bundle/syntastic"]
|
||||||
path = bundle/syntastic
|
path = vim/bundle/syntastic
|
||||||
url = https://github.com/scrooloose/syntastic.git
|
url = https://github.com/scrooloose/syntastic.git
|
||||||
[submodule "bundle/vim-javascript"]
|
[submodule "vim/bundle/vim-javascript"]
|
||||||
path = bundle/vim-javascript
|
path = vim/bundle/vim-javascript
|
||||||
url = https://github.com/pangloss/vim-javascript
|
url = https://github.com/pangloss/vim-javascript
|
||||||
[submodule "vim-vimlint"]
|
[submodule "vim/bundle/vim-vimlint"]
|
||||||
path = bundle/vim-vimlint
|
path = vim/bundle/vim-vimlint
|
||||||
url = https://github.com/syngan/vim-vimlint
|
url = https://github.com/syngan/vim-vimlint
|
||||||
[submodule "bundle/vim-vimlparser"]
|
[submodule "vim/bundle/vim-vimlparser"]
|
||||||
path = bundle/vim-vimlparser
|
path = vim/bundle/vim-vimlparser
|
||||||
url = https://github.com/ynkdir/vim-vimlparser
|
url = https://github.com/ynkdir/vim-vimlparser
|
||||||
[submodule "bundle/vim-latex"]
|
[submodule "vim/bundle/vim-latex"]
|
||||||
path = bundle/vim-latex
|
path = vim/bundle/vim-latex
|
||||||
url = git@github.com:lervag/vim-latex.git
|
url = git@github.com:lervag/vim-latex.git
|
||||||
|
|||||||
47
install.sh
47
install.sh
@@ -1,28 +1,45 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
if [ -f $HOME/.vimrc ]
|
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
|
||||||
then
|
|
||||||
echo "Already have a local vimrc, abort."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ ! -f $HOME/.vim/vimrc ]
|
confirm () {
|
||||||
then
|
# call with a prompt string or use a default
|
||||||
echo "Vimconfig rc not found, abort."
|
read -r -p "${1:-Are you sure? [y/N]} " response
|
||||||
exit 2
|
case $response in
|
||||||
fi
|
[yY][eE][sS]|[yY])
|
||||||
|
true
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
false
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
confirmAndLink() {
|
||||||
|
if [ -e $2 ]
|
||||||
|
then
|
||||||
|
echo "Destination $2 already exists and will be overwritten."
|
||||||
|
confirm && rm -rf $2 && ln -s $1 $2
|
||||||
|
else
|
||||||
|
ln -s $1 $2
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
cd $DIR && echo "Current working directory is ${DIR}"
|
||||||
|
|
||||||
echo -n "Downloading dependencies... "
|
echo -n "Downloading dependencies... "
|
||||||
cd $HOME/.vim
|
|
||||||
|
|
||||||
git submodule init &> /dev/null && git submodule update &> /dev/null \
|
git submodule init &> /dev/null && git submodule update &> /dev/null \
|
||||||
|| $(echo "Failed."; echo "Submodule installation failed."; exit 3)
|
|| $(echo "Failed."; echo "Submodule installation failed."; exit 3)
|
||||||
|
|
||||||
echo "Done."
|
echo "done."
|
||||||
|
|
||||||
|
# Install vim
|
||||||
|
|
||||||
|
echo "Installing vim."
|
||||||
|
|
||||||
|
confirmAndLink $DIR/vim/vimrc $HOME/.vimrc
|
||||||
|
confirmAndLink $DIR/vim $HOME/.vim
|
||||||
|
|
||||||
echo "Installing .vimrc"
|
|
||||||
ln -s $HOME/.vim/vimrc $HOME/.vimrc
|
|
||||||
|
|
||||||
echo
|
|
||||||
echo "Installation finished."
|
echo "Installation finished."
|
||||||
|
|||||||
Reference in New Issue
Block a user