dotfiles/setup.sh
2025-04-19 16:44:13 +08:00

52 lines
1.6 KiB
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
# File : setup.sh
# License : MIT
# Author : Feng Bohan <1953356163@qq.com>
# Date : 2025-04-18 09:02:16
# Last Modified Date: 2025-04-19 16:42:58
# Last Modified By : Feng Bohan <1953356163@qq.com>
# -----
# Copyright © 2025 Feng Bohan. All Rights Reserved.
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
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
# 安装插件
echo "请手动执行命令:PlugInstall 安装插件"
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"