1
0
Fork 0
mirror of synced 2024-09-19 12:42:55 -04:00
ultimate-vim/install_awesome_parameterized.sh
Martin Hans 5444b76f9d
Add sourcing from my_configs/
To enable structurizing of own stuff or using *dotfile*
managers, this PR add the sourcing of `*.vim` files from the
`my_config/` directory. If the
`glob("~/.vim_runtime/my_configs/*.vim",1,1)` list is empty, the
`~/.vim_runtime/my_configs.vim` is sourced as previously.
2024-05-13 11:24:03 +02:00

55 lines
1.3 KiB
Bash
Executable file

#!/bin/bash
set -e
echo 'Installing Awesome Vim from '$1
cd $1
VIMRC="\" DO NOT EDIT THIS FILE
\" Add your own customizations in $1/my_configs.vim
\" See ~/.vim_runtime/README.md \"How to include your own stuff\" for further options.
set runtimepath+=$1
source $1/vimrcs/basic.vim
source $1/vimrcs/filetypes.vim
source $1/vimrcs/plugins_config.vim
source $1/vimrcs/extended.vim
let files = glob(\"$1/my_configs/*.vim\", 1, 1)
if empty(files)
try
source $1/my_configs.vim
catch
endtry
else
for file in files
try
execute 'source' fnameescape(file)
catch
endtry
endfor
endif"
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