2025-04-18 12:07:23 +08:00
|
|
|
|
#!/bin/bash
|
|
|
|
|
# File : setup.sh
|
|
|
|
|
# License : MIT
|
|
|
|
|
# Author : Feng Bohan <1953356163@qq.com>
|
|
|
|
|
# Date : 2025-04-18 09:02:16
|
2025-04-19 17:30:12 +08:00
|
|
|
|
# Last Modified Date: 2025-04-19 17:30:00
|
2025-04-18 12:07:23 +08:00
|
|
|
|
# Last Modified By : Feng Bohan <1953356163@qq.com>
|
|
|
|
|
# -----
|
|
|
|
|
# Copyright © 2025 Feng Bohan. All Rights Reserved.
|
|
|
|
|
|
2025-04-19 09:28:22 +00:00
|
|
|
|
echo "开始配置bashrc"
|
|
|
|
|
|
|
|
|
|
# 创建符号链接
|
|
|
|
|
ln -sf "$PWD/bash/bashrc_common" ~/.bashrc_common
|
|
|
|
|
|
|
|
|
|
# 根据当前主机名链接对应的配置
|
|
|
|
|
HOSTNAME=$(hostname -s)
|
|
|
|
|
ln -sf "$PWD/bash/bashrc_$HOSTNAME" ~/.bashrc_host
|
|
|
|
|
|
|
|
|
|
# 提示用户手动 source 或重启 Shell
|
|
|
|
|
echo "已部署配置!请运行: source ~/.bashrc"
|
|
|
|
|
|
2025-04-19 16:44:13 +08:00
|
|
|
|
echo "开始配置字体"
|
|
|
|
|
wget https://github.com/ryanoasis/nerd-fonts/releases/download/v3.3.0/JetBrainsMono.zip
|
|
|
|
|
wget https://github.com/ryanoasis/nerd-fonts/releases/download/v3.3.0/FiraCode.zip
|
|
|
|
|
wget https://github.com/ryanoasis/nerd-fonts/releases/download/v3.3.0/Hack.zip
|
|
|
|
|
fonts_path="~/.local/share/fonts"
|
|
|
|
|
if [ ! -d $fonts_path ]; then
|
|
|
|
|
mkdir -p ~/.local/share/fonts
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
echo "开始解压字体"
|
|
|
|
|
unzip FiraCode.zip -d ~/.local/share/fonts/FiraCodeNerdFont
|
|
|
|
|
unzip JetBrainsMono.zip -d ~/.local/share/fonts/JetBrainsMonoNerdFont
|
|
|
|
|
unzip Hack.zip -d ~/.local/share/fonts/HackNerdFont
|
|
|
|
|
|
|
|
|
|
echo "刷新字体缓存"
|
|
|
|
|
fc-cache -fv
|
|
|
|
|
|
2025-04-18 12:07:23 +08:00
|
|
|
|
echo "开始配置VIM"
|
|
|
|
|
# 链接配置文件
|
|
|
|
|
ln -sf ~/dotfiles/vim/.vimrc ~/.vimrc
|
|
|
|
|
|
|
|
|
|
# 安装 Vim-Plug(如未安装)
|
|
|
|
|
if [ ! -f ~/.vim/autoload/plug.vim ]; then
|
|
|
|
|
curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
|
|
|
|
|
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
|
|
|
|
|
fi
|
|
|
|
|
|
2025-04-19 17:30:12 +08:00
|
|
|
|
# 安装插件
|
|
|
|
|
echo "请手动执行命令:PlugInstall 安装插件"
|
|
|
|
|
|