这是我的个人 dotfiles 仓库,使用 chezmoi 和 Homebrew 进行管理。
- ZSH 配置
- 常用别名和函数
- 终端提示符配置 (Starship)
- 常用工具安装 (通过 Homebrew)
# 克隆仓库
git clone https://github.com/yourusername/dotfiles.git
cd dotfiles
# 运行安装脚本
./install.sh
-
安装 Homebrew:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
-
安装 chezmoi:
brew install chezmoi
-
初始化 chezmoi:
chezmoi init --apply
-
安装依赖:
brew bundle --file=brew/Brewfile
当您对配置进行更改后,可以使用以下命令应用更改:
chezmoi apply
chezmoi add ~/.some_config_file
本地特定的配置可以添加到 ~/.local_rc
文件中,该文件不会被版本控制系统跟踪。
该 repo 是邹颖个人的 dotfiles。其中包含,
-
git 配置
-
neovim 配置
-
tmux 配置
-
zsh 配置
-
utils:其他常用的小工具
配置目录:./git_config
- 安装
进入目录后,运行命令
cd ./git_config
bash ./install.sh
- [Popular Git Config Options](https://jvns.ca/blog/2024/02/16/popular-git-config-options)
配置目录:./neovim_config
- 安装
进入目录后,运行命令配置 neovim 的配置
cd ./neovim_config
# 会安装部分工具:vim-plugin
bash ./config_neovim.sh
- 安装 nvim 插件
nvim
:PlugInstall
配置目录:./tmux_config
- 安装 tmux
brew install tmux
- 配置 tmux
# 其中会安装tpm(tmux plugin manager),用于管理插件
bash ./install_tmux.bash
配置目录:./zshrc_conf
- 确定系统已经安装 zsh
# 安装zsh
brew install zsh
- 安装 oh-my-zsh 配置
# 其中会安装oh-my-zsh和zplus
bash ./install_zsh.sh
-
zsh 环境变量设置
-
$HOME/.zy_alias_rc:设置较为通用的环境变量
-
$HOME/.local_rc:设置当前机器的环境变量,该文件不上传到 repo 管理,只对当前机器有效。比如当前当前服务器的自定义 PATH 路径。
-
# San Francisco Mono
brew install --cask font-sf-mono
# Microsoft Cascadia: Cascadia Code, Cascadia (Code|Mono) NF
brew install font-cascadia-code font-cascadia-mono-nf
# Intel One Mono
brew install --cask font-intel-one-mono
brew install --cask font-monaspace
- Nerd tree font: vim-devicons
- fzf: fzf
brew install fzf
- rg: rg -
brew install ripgrep
- ag:
brew install the_silver_searcher
- fd:better find tools.
brew install fd
- Log file navigator
cat ~/.pip/pip.conf
[global]
index-url = https://pypi.douban.com/simple/
trusted-host = pypi.douban.com
git branch -d $(git branch --merged=master | grep -v master)
git fetch --prune
Ref: 如何给码农 👨💻 的 Mac 开光
# install Command Line Tools
$ xcode-select --install
# install software manager homebrew(maybe very slowly - you can use cellular)
$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# brew的国内源
$ cd "$(brew --repo)"
$ git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.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
# alias
alias dkst="docker stats"
alias dkpsa="docker ps -a"
alias dkimgs="docker images"
alias dkcpup="docker-compose up -d"
alias dkcpdown="docker-compose down"
alias dkcpstart="docker-compose start"
alias dkcpstop="docker-compose stop"
alias setproxy="export ALL_PROXY=socks5://127.0.0.1:1086" # terminal proxy
alias unsetproxy="unset ALL_PROXY"
Better for:
-
ls: exa
-
curl: httpie
-
curl: bat
-
grep: rg/ripgrep
-
find: fd
-
diff: diff-so-fancy
-
man: tldr
-
termshark - A terminal UI for tshark, inspired by Wireshark
-
mark-directory - Provides a quick way to change directory from the command line.
-
better git diff: git-delta
-
local https 证书 - mkcert