-
Notifications
You must be signed in to change notification settings - Fork 15
/
install.sh
executable file
·70 lines (60 loc) · 1.89 KB
/
install.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#!/bin/sh
# vars
_VIM_PATH="$HOME/.vim"
_VIM_BK_PATH="$HOME/vim-bk"
_ARCHIVE_NAME="uctags-2024.06.20-linux-x86_64.tar.gz"
_ARCHIVE_EXTRACTED_NAME="uctags-2024.06.20-linux-x86_64"
_COC_JSON="https://raw.githubusercontent.com/wolandark/wim/master/config/coc-settings.json"
_CHEAT_FILE="https://raw.githubusercontent.com/wolandark/wim/master/config/cheat40.txt"
_VIMRC_FILE="$_VIM_PATH/vimrc"
_VIMRC_FILE_REMOTE="https://raw.githubusercontent.com/wolandark/wim/master/wim-vim"
_VIMWIKI_PATH="$_VIM_PATH/vimwiki"
_VIMWIKI_INDEX="index.wiki"
_VIMWIKI_WIM="Wim.wiki"
_VIMWIKI_WIM_REMOTE="https://raw.githubusercontent.com/wolandark/wim/master/config/Wim.wiki"
# backup
backup()
{
if [ -d "$_VIM_PATH" ]; then
mv "$_VIM_PATH" "$_VIM_BK_PATH"
mkdir -p "$_VIM_PATH"
else
mkdir -p "$_VIM_PATH"
fi
}
# download
downloadCtags()
{
ctags_url="https://github.com/universal-ctags/ctags-nightly-build/releases/download/2024.06.20%2B8976ec3d2c48ec862593910388ae3e55f0e20a3f/uctags-2024.06.20-linux-x86_64.tar.gz"
curl -Lo "$_ARCHIVE_NAME" "$ctags_url"
tar -xzf "$_ARCHIVE_NAME"
mkdir -p "$_VIM_PATH/uctags"
mv "$_ARCHIVE_EXTRACTED_NAME"/* "$_VIM_PATH/uctags/"
rm -rf "$_ARCHIVE_EXTRACTED_NAME"
rm "$_ARCHIVE_NAME"
}
getFiles()
{
curl -fLo "$_VIM_PATH/cheat40.txt" "$_CHEAT_FILE"
curl -fLo "$_VIM_PATH/coc-settings.json" "$_COC_JSON"
curl -fLo "$_VIMRC_FILE" "$_VIMRC_FILE_REMOTE"
}
setupVimWiki()
{
mkdir -p "$_VIMWIKI_PATH"
curl -fLo "$_VIMWIKI_PATH/$_VIMWIKI_WIM" "$_VIMWIKI_WIM_REMOTE"
echo "[[Wim]]" >> "$_VIMWIKI_PATH/$_VIMWIKI_INDEX"
}
main()
{
backup
downloadCtags
getFiles
setupVimWiki
}
main
printf "\e[42;30mFile Accusation Successful! Launching Vim!\e[0m\n"
printf "\e[43;30mPress Enter To Continue...\e[0m\n"
printf "\e[44;30mWhen CoC finishes installing a few extensions, you can exit Vim.\e[0m\n"
vim
printf "\e[42;30mAll Done! Enjoy!\e[0m\n"