aboutsummaryrefslogtreecommitdiff
path: root/install.sh
diff options
context:
space:
mode:
authorOxbian <oxbian@mailbox.org>2025-09-07 10:27:25 +0200
committerOxbian <oxbian@mailbox.org>2025-09-07 10:27:25 +0200
commita92789e8707d2a077bc6d3fedfcdf377bc6ceba1 (patch)
tree04c01305c62f8e3c353beb5e62da08845d3df230 /install.sh
parent08dcec61aef0fed78b6d94ff97faeb1312d862e7 (diff)
downloadvimrc-a92789e8707d2a077bc6d3fedfcdf377bc6ceba1.tar.gz
vimrc-a92789e8707d2a077bc6d3fedfcdf377bc6ceba1.zip
feat: vim install script + theme update
Diffstat (limited to 'install.sh')
-rwxr-xr-xinstall.sh41
1 files changed, 41 insertions, 0 deletions
diff --git a/install.sh b/install.sh
new file mode 100755
index 0000000..5691fc4
--- /dev/null
+++ b/install.sh
@@ -0,0 +1,41 @@
+#!/usr/bin/env sh
+# POSIX script for setting up VIM
+
+set -euo pipefail
+
+# Variables
+script_name="$(basename "${0}")"
+title='\033[1;36m'
+red='\033[1;31m'
+green='\033[1;32m'
+reset='\033[0m'
+
+readonly script_name title red green reset
+
+clean_exit() {
+
+ local status="${?}"
+
+ if [ "${status}" != 0 ]; then
+ printf "${red}%s (code: %s)${reset}\n" "VIM install failed" ${status}
+ else
+ printf "${green}%s${reset}\n" "VIM install succeed"
+ fi
+}
+
+trap clean_exit EXIT
+
+# Ask if user want to copy the project in ~/.vim
+printf "${title}Do you want to copy VIM config in ~/.vim ? [N/y]${reset}\n"
+read -r choice
+case "$choice" in
+ y|Y)
+ cp -r . ~/.vim
+ printf "${green}%s${reset}\n" "VIM config copied in ~/.vim"
+ ;;
+ *)
+ ;;
+esac
+
+sed -i s#\.config\/vim#\.vim## ~/.vim/conf/plugins.vim
+sed -i s#\.config\/vim#\.vim## ~/.vim/vimrc
ArKa projects. All rights to me, and your next child right arm.