-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·67 lines (61 loc) · 1.6 KB
/
install.sh
File metadata and controls
executable file
·67 lines (61 loc) · 1.6 KB
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
#!/bin/bash
# Store the original user's home directory
set -e
function programs() {
apt update && apt upgrade -y
apt install -y vim tmux ripgrep xclip tree curl jq fzf nomacs gitk meld
install_neovim
}
function conf() {
cp config/.vimrc ~
cp config/.tmux.conf ~
cp config/.bashrc ~
cp config/.gitignore ~
cp -r config/nvim ~/.config
git config --global core.excludesfile ~/.gitignore
git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim || true
echo "==> Installing runtime config is completed!!!"
}
function snapshot() {
cp ~/.vimrc config
cp ~/.tmux.conf config
cp ~/.bashrc config
cp ~/.gitignore config
rm -rf config/nvim
cp -r ~/.config/nvim config
echo "==> Snapshoting config files is completed!!!"
}
function install_neovim() {
local version="v0.10.0"
local url="https://github.com/neovim/neovim/releases/download/${version}/nvim-linux64.tar.gz"
local temp_dir=$(mktemp -d)
echo "Downloading Neovim ${version} from ${url}..."
curl -L ${url} -o ${temp_dir}/nvim-linux64.tar.gz
echo "Extracting Neovim..."
tar -xzvf ${temp_dir}/nvim-linux64.tar.gz -C ${temp_dir}
echo "Installing Neovim..."
sudo mv ${temp_dir}/nvim-linux64 /usr/local/nvim
echo "Creating symlink for Neovim..."
sudo ln -sf /usr/local/nvim/bin/nvim /usr/local/bin/nvim
echo "Cleaning up..."
rm -rf ${temp_dir}
echo "Neovim ${version} installation completed!"
}
case "$1" in
all)
programs
conf
;;
programs)
programs
;;
conf)
conf
;;
snapshot)
snapshot
;;
*)
echo "Usage: $0 {all|programs|conf|snapshot}"
exit 1
esac