-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·51 lines (37 loc) · 1.56 KB
/
Copy pathsetup.sh
File metadata and controls
executable file
·51 lines (37 loc) · 1.56 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
#!/bin/sh
. ~/.local/config/setup-scripts/tools.sh
# 配置 vim 为 git 的默认编辑器
git config --global core.editor vim
# 安装 zsh
PRINT "安装 zsh"
sudo apt install -y zsh
# 安装 Oh My Zsh
PRINT "安装 Oh My Zsh"
export RUNZSH=no # 安装完成后不立即切换至 zsh
# echo | 可以在 oh-my-zsh 安装过程中自动按回车
echo | sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
# 安装 zsh 插件
PRINT "安装 zsh-autosuggestions 插件"
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
PRINT "安装 zsh-syntax-highlighting 插件"
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
PRINT "安装 zsh-history-substring-search 插件"
git clone https://github.com/zsh-users/zsh-history-substring-search ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-history-substring-search
echo "source ~/.local/config/setup-scripts/zshrc" >> ~/.zshrc
# 安装 tmux
PRINT "安装 tmux"
sudo apt install -y tmux
# 安装 tpm
PRINT "安装 tmux 插件管理器 tpm"
git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
echo "source ~/.local/config/setup-scripts/tmux.conf" >> ~/.tmux.conf
# 安装 tmux 插件
PRINT "安装 tmux 插件"
cd ~/.tmux/plugins/tpm/bin/
sh install_plugins
cd ~
# 配置 vim
echo "source ~/.local/config/setup-scripts/vimrc" >> ~/.vimrc
PRINT "初始化完成,切换到 zsh"
read -p "按 Enter 进入新环境:" var
exec zsh -l