homebrew
# 安装
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# 替换brew.git
cd "$(brew --repo)"
git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git
# 替换homebrew-core.git
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git
# 刷新源
brew update
oh-my-zsh
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
zsh插件
插件在.zshrc
里配置,找到plugins
关键字,加载插件;系统默认加载git
,可以追加内容,如下:
plugins=(
git
z
zsh-autosuggestions
zsh-syntax-highlighting
)
zsh-autosuggestions(历史命令智能提示)
git clone https://github.com/zsh-users/zsh-autosuggestions $ZSH_CUSTOM/plugins/zsh-autosuggestions
zsh-syntax-highlighting(命令语法高亮)
git clone https://github.com/zsh-users/zsh-syntax-highlighting $ZSH_CUSTOM/plugins/zsh-syntax-highlighting
主题 Powerlevel10k
字体
jetbrain-mono
配色
Dracula
下载完成以后,通过 Profiles
-> Color
-> Color Presets
-> Import
,选择所下载的文件夹,找到目录下的schemes
文件夹,选中里面你想要的主题,点击open
导入,然后就可以使用了。
Vim
仅用于临时在终端做简单修改,极简即可
" 基础设置
set nocompatible " 不兼容 Vi 模式
syntax on " 开启语法高亮
set number " 显示行号
set cursorline " 高亮当前行
" 缩进与空格
set tabstop=4 " Tab 显示为4个空格
set shiftwidth=4 " 缩进使用4个空格
set expandtab " 将 Tab 转为空格
set autoindent " 继承前一行的缩进
" 搜索
set ignorecase " 搜索忽略大小写
set smartcase " 如果包含大写则区分大小写
set hlsearch " 高亮搜索结果
set incsearch " 边输入边搜索
" 视觉增强
set wrap " 自动换行
set showmatch " 括号配对高亮
set background=dark " 深色背景(适配大多数 dark theme)
" 状态栏优化
set laststatus=2 " 始终显示状态栏
set ruler " 显示光标位置
" 文件与备份
set noswapfile " 不使用 swap 文件
set nobackup " 不生成备份文件
" 快捷键(可选)
nnoremap <Space> :noh<CR> " 空格键清除搜索高亮