58 lines
1.5 KiB
Bash
Executable File
58 lines
1.5 KiB
Bash
Executable File
#!/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 17:42:03
|
||
# Last Modified By : Feng Bohan <1953356163@qq.com>
|
||
# -----
|
||
# Copyright © 2025 Feng Bohan. All Rights Reserved.
|
||
|
||
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"
|
||
|
||
echo "开始配置字体"
|
||
fonts_path="~/.local/share/fonts"
|
||
if [ ! -d $fonts_path ]; then
|
||
mkdir -p ~/.local/share/fonts
|
||
fi
|
||
|
||
get_fonts(){
|
||
if [ -f $1.zip ]; then
|
||
echo "$1.zip is already exists."
|
||
else
|
||
echo "start download $1.zip."
|
||
wget https://github.com/ryanoasis/nerd-fonts/releases/download/v3.3.0/$1.zip
|
||
unzip $1.zip -d ~/.local/share/fonts/$1NerdFont
|
||
fi
|
||
}
|
||
get_fonts "JetBrainsMono"
|
||
get_fonts "FiraCode"
|
||
get_fonts "Hack"
|
||
|
||
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 安装插件"
|
||
|