Table of contents
系统设置
程序坞自动隐藏加速
# 设置启动坞动画时间设置为 0.5 秒
defaults write com.apple.dock autohide-time-modifier -float 0.5 && killall Dock
# 设置启动坞响应时间最短
defaults write com.apple.dock autohide-delay -int 0 && killall Dock
# 恢复启动坞默认动画时间
defaults delete com.apple.dock autohide-time-modifier && killall Dock
# 恢复默认启动坞响应时间
defaults delete com.apple.Dock autohide-delay && killall Dock
启动台自定义行和列
# 设置列数
defaults write com.apple.dock springboard-columns -int 7
# 设置行数
defaults write com.apple.dock springboard-rows -int 6
# 重启 Dock 生效
killall Dock
# 恢复默认的列数和行数
defaults write com.apple.dock springboard-rows Default
defaults write com.apple.dock springboard-columns Default
# 重启 Dock 生效
killall Dock
解除 history
输出条数过少的限制
export HISTSIZE=100000
export HISTFILESIZE=100000
常用软件安装
命令行工具
统一采用 Homebrew 对系统软件包进行管理,安装命令行工具时,优先考虑 Homebrew 提供的软件包。
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
- Oh My Zsh:一个开源的、社区驱动的框架,用于管理 zsh 配置,安装如下插件:
- Starship:基于 Rust 的跨平台的 Shell 提示符,具有轻量、迅速、客制化的特点,选用 Tokyo Night 主题;
差生文具多:
Prefer | Description | Replace |
---|---|---|
eza | A modern, maintained replacement for ls. | ls |
zoxide | A smarter cd command, supports all major shells. | cd |
htop | An interactive process viewer. | top |
ripgrep | ripgrep recursively searches directories for a regex pattern while respecting your gitignore | grep |
ncdu | Ncdu (NCurses Disk Usage) is a disk usage analyzer with an ncurses interface. | du |
bat | A cat(1) clone with wings. | cat |
fd | A simple, fast and user-friendly alternative to ‘find’ | find |
procs | A modern replacement for ps written in Rust. | ps |
fzf | A general-purpose command-line fuzzy finder written in Go. | find |
fzf-tab | Replace zsh’s default completion selection menu with fzf. | find |
tokei | A program that displays statistics about your code. | cloc |
tldr | Collaborative cheatsheets for console commands. | man |
thefuck | Magnificent app which corrects your previous console command. | - |
lazygit | A simple terminal UI for git commands. | git |
lazydocker | A simple terminal UI for both docker and docker-compose. | docker |
fastfetch | Like neofetch, but much faster because written mostly in C. | neofetch |
delta | A syntax-highlighting pager for git, diff, and grep output. | diff |
部分 alias 定义于 ~/.zshrc
如下:
alias ls="eza"
alias ll="eza --time-style=long-iso --icons --group --git --binary -lg"
alias tree="eza --tree --icons"
alias cls="clear"
开发工具
- Warp:一个由 Rust 编写的跨平台终端,性能优秀,同时还有 AI 加持;
- VS Code:常用的轻量级代码编辑器,部分推荐插件如下:
- Zed Editor:采用 Rust 构建,性能强大速度快,支持 Copilot 和实时协作等,目前作为主力编辑器使用;
GUI 工具
统一采用 Homebrew Cask 进行管理。
$ brew list
==> Formulae
...
==> Casks
1password iina plex
alacritty jellyfin sabnzbd
applite loop transmit
daisydisk lulu tuxera-ntfs
downie netnewswire typora
font-jetbrains-mono-nerd-font notion zed
font-lxgw-wenkai orbstack
handbrake pictureview
编程语言版本管理
- Python: uv -> An extremely fast Python package installer and resolver, written in Rust
- Node: fnm -> Fast and simple Node.js version manager, built in Rust
- Java: jenv -> Java enVironment Manager
- Go: gvm -> Go Version Manager
- Rust: rustup -> The Rust toolchain installer
MacOS 软件一键更新
准备工作
- 安装 brew-cask-upgrade:
brew tap buo/cask-upgrade
- 验证
brew-cask-upgrade
是否安装成功:brew tap | grep buo/cask-upgrade
- 安装 mas,一个用于管理 Mac App Store 上的应用的命令行工具:
brew install mas
更新软件
升级所有已安装的软件:
brew update && brew upgrade && brew cu --all --yes --cleanup \
&& mas upgrade && brew cleanup
-
brew update
:更新 Homebrew 自身及其相关软件源的信息,确保 Index 信息准确; -
brew upgrade
:将系统中已安装的所有 Homebrew 软件包升级到最新版本; -
brew cu --all --yes --cleanup
:自动升级所有可更新的 Homebrew cask 软件包到最新版本,并在完成后清理删除旧版本;
- —all: Include apps that auto-update in the upgrade.
- —yes: Update all outdated apps; answer yes to updating packages.
- —cleanup: Cleans up cached downloads and tracker symlinks after updating.
-
mas upgrade
: 一键更新从 Mac App Store 安装的应用程序; -
brew cleanup
: 用于清理 Homebrew 安装的软件包时产生的临时文件和缓存,以释放磁盘空间。
执行结果样例如下:
可以作为定时任务,周期性执行,以保持 Mac 上软件为最新版本。