mirror of
https://github.com/frebib/dotfiles.git
synced 2024-06-14 12:57:23 +00:00
Modernise and improve vim-setup script
This commit is contained in:
parent
bd549b6424
commit
3351a95a0a
3
.profile
3
.profile
@ -9,7 +9,8 @@ export PATH="${PATH}:$DOTFILES/scripts"
|
|||||||
export XDG_CURRENT_DESKTOP="GNOME" # Fixes xdg-open
|
export XDG_CURRENT_DESKTOP="GNOME" # Fixes xdg-open
|
||||||
|
|
||||||
# Allow Vim to load from ~/.config/vim
|
# Allow Vim to load from ~/.config/vim
|
||||||
export MYVIMRC="$CONFIG_DIR/vim/vimrc"
|
export VIMDIR="$CONFIG_DIR/vim"
|
||||||
|
export MYVIMRC="$VIMDIR/vimrc"
|
||||||
export VIMINIT=":so $MYVIMRC"
|
export VIMINIT=":so $MYVIMRC"
|
||||||
|
|
||||||
export EDITOR="vim"
|
export EDITOR="vim"
|
||||||
|
@ -1,18 +1,29 @@
|
|||||||
YCM=~/.vim/bundle/YouCompleteMe
|
#!/bin/sh
|
||||||
|
set -e
|
||||||
|
|
||||||
sudo pacman -Sy python cmake clang --needed --noconfirm
|
############################
|
||||||
|
## Check for dependencies ##
|
||||||
|
############################
|
||||||
|
error() { >&2 printf "Error: %s" "$1"; exit 1; }
|
||||||
|
|
||||||
|
which cmake >/dev/null 2>&1 || error 'cmake is not installed'
|
||||||
|
which clang >/dev/null 2>&1 || error 'clang is not installed'
|
||||||
|
which python >/dev/null 2>&1 || error 'python is not installed'
|
||||||
|
|
||||||
|
[ -z "$VIMDIR" ] && error '$VIMDIR is not set'
|
||||||
|
|
||||||
#######################
|
#######################
|
||||||
## Initialise Vundle ##
|
## Initialise Vundle ##
|
||||||
#######################
|
#######################
|
||||||
mkdir -p ~/.vim/{bundle,swapfiles}
|
mkdir -p "$VIMDIR/bundle" "$VIMDIR/swapfiles"
|
||||||
git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
|
if [ ! -d "$VIMDIR/bundle/Vundle.vim" ]; then
|
||||||
|
git clone https://github.com/VundleVim/Vundle.vim.git "$VIMDIR/bundle/Vundle.vim"
|
||||||
|
fi
|
||||||
vim +PluginUpdate +qall
|
vim +PluginUpdate +qall
|
||||||
|
|
||||||
|
|
||||||
#########################
|
#########################
|
||||||
## Setup YouCompleteMe ##
|
## Setup YouCompleteMe ##
|
||||||
#########################
|
#########################
|
||||||
cd "$YCM"
|
cd "$VIMDIR/bundle/YouCompleteMe"
|
||||||
git submodule update --init --recursive
|
git submodule update --init --recursive
|
||||||
./install.py --system-libclang --clang-completer
|
./install.py --system-libclang --clang-completer
|
||||||
|
Loading…
Reference in New Issue
Block a user