forked from amix/vimrc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Parameterized install script (amix#337)
Make Awesome install script parameterizable for central VIMRC management
- Loading branch information
Showing
2 changed files
with
53 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
echo 'Installing Awesome Vim from '$1 | ||
cd $1 | ||
|
||
VIMRC="set runtimepath+=$1 | ||
source $1/vimrcs/basic.vim | ||
source $1/vimrcs/filetypes.vim | ||
source $1/vimrcs/plugins_config.vim | ||
source $1/vimrcs/extended.vim | ||
try | ||
source $1/my_configs.vim | ||
catch | ||
endtry" | ||
|
||
if [ $2 == "--all" ]; then | ||
USERS=($(ls -l /home | awk '{if(NR>1)print $9}')) | ||
for user in ${USERS[*]}; do | ||
homepath=$(eval echo "~$user") | ||
IFS='' | ||
echo $VIMRC > ${homepath}/.vimrc | ||
unset IFS | ||
echo "Installed the Ultimate Vim configuration for user $user successfully! Enjoy :-)" | ||
done | ||
echo "Installed the Ultimate Vim configuration successfully! Enjoy :-)" | ||
exit 0 | ||
else | ||
SELECTED_USERS=(${@:2}) | ||
echo "Selected users: ${SELECTED_USERS[@]}" | ||
for user in ${SELECTED_USERS[@]}; do | ||
homepath=$(eval echo "~$user") | ||
IFS='' | ||
echo $VIMRC > ${homepath}/.vimrc | ||
unset IFS | ||
echo "Installed the Ultimate Vim configuration for user $user successfully! Enjoy :-)" | ||
done | ||
exit 0 | ||
fi |