Skip to content

Instantly share code, notes, and snippets.

@hyoban
Last active March 22, 2025 01:51
Show Gist options
  • Save hyoban/7943d4c59c43b79d3f8388671437fe11 to your computer and use it in GitHub Desktop.
Save hyoban/7943d4c59c43b79d3f8388671437fe11 to your computer and use it in GitHub Desktop.
Hyoban's dotfiles
[user]
name = Stephen Zhou
email = [email protected]
signingkey = ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDg/3T8nsnp4yqbQ0PFTs2rFZZZ7z6WFzIkp+r5EXdQB
[init]
defaultBranch = main
[core]
quotepath = false
[gpg]
format = ssh
[commit]
gpgsign = true
[filter "lfs"]
required = true
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
[gpg "ssh"]
program = /Applications/1Password.app/Contents/MacOS/op-ssh-sign
# https://ohmyz.sh
# sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
export ZSH="$HOME/.oh-my-zsh"
# https://github.com/ohmyzsh/ohmyzsh/blob/master/plugins/git/README.md
plugins=(
git
)
# https://github.com/spaceship-prompt/spaceship-prompt
# git clone https://github.com/spaceship-prompt/spaceship-prompt.git "$ZSH_CUSTOM/themes/spaceship-prompt" --depth=1
# ln -s "$ZSH_CUSTOM/themes/spaceship-prompt/spaceship.zsh-theme" "$ZSH_CUSTOM/themes/spaceship.zsh-theme"
ZSH_THEME="spaceship"
# git clone https://github.com/hyoban/spaceship-node-package-manager.git $ZSH_CUSTOM/plugins/spaceship-node-package-manager
# git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
# git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
plugins=(
$plugins
spaceship-node-package-manager
zsh-autosuggestions
zsh-syntax-highlighting
)
source $ZSH/oh-my-zsh.sh
spaceship add node_package_manager --before exec_time
# https://github.com/tj/n
# brew install n
export N_PREFIX=$HOME/.n
export PATH=$N_PREFIX/bin:$PATH
alias s="nr start"
alias d="nr dev"
alias b="nr build"
alias bw="nr build --watch"
alias t="nr test"
alias tu="nr test -u"
alias tw="nr test --watch"
alias w="nr watch"
alias p="nr preview"
alias c="nr typecheck"
alias lint="nr lint"
alias lintf="nr lint --fix"
alias dev="git checkout dev"
alias main="git checkout main"
alias master="git checkout master"
# -------------------------------- #
# Directories
#
# Optional, needs gh installed
# brew install gh
#
# I put
# `~/i` for my projects
# `~/f` for forks
# `~/r` for reproductions
# -------------------------------- #
function i() {
cd ~/i/$1
}
function repros() {
cd ~/r/$1
}
function forks() {
cd ~/f/$1
}
function pr() {
if [ $1 = "ls" ]; then
gh pr list
else
gh pr checkout $1
fi
}
function dir() {
mkdir $1 && cd $1
}
function clone() {
if [[ -z $2 ]] then
gh repo clone "$@" && cd "$(basename "$1" .git)"
else
gh repo clone "$@" && cd "$2"
fi
}
# Clone to ~/i and cd to it
function clonei() {
i && clone "$@" && code . && cd ~2
}
function cloner() {
repros && clone "$@" && code . && cd ~2
}
function clonef() {
forks && clone "$@" && code . && cd ~2
}
function codei() {
i && code "$@" && cd -
}
function coder() {
repros && code "$@" && cd -
}
function codef() {
forks && code "$@" && cd -
}

Finder

  • General
    • Show these items on the desktop (Turn off all)
    • New Finder windows show (Home folder)
  • Sidebar
    • Hide tags; Show home folder and all Locations and iCloud
  • Advanced
    • Show all filename extensions (On)
  • View -> Show Path Bar (On)
  • Top folder -> Right click -> Show View Options -> Sort by Name, Use as Defaults

Desktop & Dock

  • Remove all apps from Dock
  • Dock
    • Automatically hide and show the Dock (On)
    • Show suggested and recent apps in Dock (Off)
  • Desktop & Stage Manager
    • Click wallpaper to reveal desktop (Only in Stage Manager)
  • Windows
    • Tiled windows have margins (Off)
  • Hot Corners (Only for Desktop)
    • Bottom left: Launchpad
    • Bottom right: Mission Control

Control Center

  • Don't show in menu bar (Spotlight)
  • Clock Options
    • Display the time with seconds (On)

Keyboard

  • Keyboard navigation (On)
  • Key repeat rate (Fast) and Delay until repeat (Short)
  • Text Input
    • Add period with double-space (Off)
  • Keyboard Shortcuts
    • Screenshots (Turn off all, use CleanShot X)
    • Spotlight (Turn off, use Raycast)
    • Modifier keys (Caps Lock -> Control)

Trackpad

  • Tap to click (On)

Accessibility

  • Pointer Control -> Trackpad Options
    • Use trackpad for dragging (On)
    • Dragging style (Three finger drag)

Apple ID

软件列表

基本上来说软件安装完了,就无法恢复安装之前的状态,清理卸载残留是没有意义的,不如隔一段时间重置系统。不要花时间来清理,只要保持只安装不可以避免的软件即可。

Surge

  • 非必要不安装(在家可以使用 Mac mini 来代理)
  • 暂时未找到体验上和 Surge 一样好用的软件,不要折腾

Homebrew

  • 注意安装完写入环境变量

Chrome

  • 登录同步
  • 不用 brave,不好用

Raycast

CleanShot X

  • 自动保存截图到剪贴板

1Password

  • 注意下载的是安装器
  • 设置拓展和 mac 互通
  • 拓展关闭填充后自动提交
  • 关闭开机自启

vscode

  • 注意下载 arm only 版本
  • 设置同步

开发

  • 设置 gitconfig 和 1password agent
  • git ssh over https
  • 设置终端、gh 登录
  • 安装 node corepack
  • 拉代码,测试 git
  • 安装字体

XCode

非必要不安装(可使用 ci 来构建 expo dev client)

  • brew install CocoaPods
  • xcode 安装完可能需要设置里选一下路径

OrbStack

非必要不安装(在家可以连 nas 的 docker 服务)

Mac Mouse Fix

非必要不安装(MacBook 可以尽量触控板?)

  • 关闭按键绑定
{
"workbench.editor.limit.enabled": true,
"workbench.editor.limit.perEditorGroup": true,
"workbench.editor.limit.value": 5,
"workbench.sideBar.location": "right",
"workbench.activityBar.location": "top",
"breadcrumbs.enabled": false,
"editor.accessibilitySupport": "off",
"editor.bracketPairColorization.enabled": false,
"editor.minimap.enabled": false,
"editor.renderLineHighlight": "none",
"security.workspace.trust.enabled": false,
"window.commandCenter": false,
"window.restoreWindows": "none",
"workbench.layoutControl.enabled": false,
"workbench.startupEditor": "none",
"workbench.tips.enabled": false,
"editor.fontFamily": "Monolisa Variable",
"editor.fontSize": 15,
"terminal.integrated.fontSize": 15,
"editor.fontVariations": true,
"editor.lineHeight": 25,
"editor.tokenColorCustomizations": {
"textMateRules": [
{
"scope": "comment",
"settings": {
"fontStyle": "italic"
}
}
]
},
// git related
"diffEditor.ignoreTrimWhitespace": true,
"git.autofetch": true,
"git.confirmSync": false,
"git.enableSmartCommit": true,
"gitlens.codeLens.enabled": false,
"gitlens.currentLine.enabled": false,
"gitlens.hovers.currentLine.over": "line",
"gitlens.hovers.enabled": false,
"gitlens.launchpad.indicator.enabled": false,
"gitlens.views.scm.grouped.views": {
"commits": false,
"branches": false,
"remotes": true,
"stashes": false,
"tags": true,
"worktrees": true,
"contributors": true,
"repositories": false,
"searchAndCompare": false,
"launchpad": false
},
// animations
"editor.cursorBlinking": "smooth",
"editor.cursorSmoothCaretAnimation": "on",
"editor.smoothScrolling": true,
"workbench.list.smoothScrolling": true,
"window.title": "${rootName}${separator}${activeEditorLong}",
// "editor.renderWhitespace": "boundary",
"workbench.colorTheme": "Default Light Modern",
"files.simpleDialog.enable": true,
"zenMode.fullScreen": false,
// others
"files.readonlyFromPermissions": true,
"files.readonlyInclude": {
"**/node_modules/**": true,
"**/package-lock.json": true,
"**/pnpm-lock.yaml": true,
"**/yarn.lock": true
},
"search.exclude": {
"**/.DS_Store": true,
"**/.git": true,
"**/.hg": true,
"**/.svn": true,
"**/CVS": true,
"**/Thumbs.db": true,
"**/package-lock.json": true,
"**/pnpm-lock.yaml": true,
"**/yarn.lock": true
},
"github.copilot.editor.enableCodeActions": false,
"github.copilot.enable": {
"*": true,
"plaintext": false,
"markdown": true,
"scminput": false
},
"debug.onTaskErrors": "debugAnyway",
"files.exclude": {
"**/.DS_Store": false,
"**/.git": false,
"**/.hg": false,
"**/.svn": false,
"**/CVS": false,
"**/Thumbs.db": false
},
"githubPullRequests.pullBranch": "never",
// "tailwindcss-classname-highlight.enableHoverProvider": true,
"diffEditor.renderSideBySide": true,
"scm.showHistoryGraph": false,
"workbench.editor.empty.hint": "hidden",
"catppuccin-icons.specificFolders": true,
"window.autoDetectColorScheme": true,
"workbench.preferredDarkColorTheme": "GitHub Dark Default",
"workbench.preferredLightColorTheme": "GitHub Light Default",
"diffEditor.experimental.showMoves": true,
"editor.lineNumbers": "off",
"typescript.updateImportsOnPaste.enabled": false,
"javascript.updateImportsOnPaste.enabled": false,
"editor.renderWhitespace": "boundary",
"cSpell.diagnosticLevel": "Hint",
"iconify.inplace": false,
// "tailwindCSS.annotations": true,
"tailwindCSS.colorDecorators": false,
"unocss.colorPreview": false,
"errorLens.enabledDiagnosticLevels": ["error", "warning", "info", "hint"],
"errorLens.exclude": [
"^\".*\": Unknown word\\.$"
// "Classname '.*' is not a Tailwind CSS class!"
// ".* is defined but never used",
// ".* is declared but never used",
// ".* is assigned a value but never used",
// ".* is declared but its value is never read"
],
"errorLens.fontStyleItalic": true,
"markdownlint.config": {
"no-bare-urls": false,
"no-inline-html": false,
"fenced-code-language": false,
"no-duplicate-heading": false,
"no-alt-text": false,
"first-line-h1": false
},
"github.copilot.nextEditSuggestions.enabled": true,
"diffEditor.hideUnchangedRegions.enabled": true,
"files.associations": {
".env.*": "dotenv"
},
"RadonIDE.panelLocation": "secondary-side-panel",
"workbench.iconTheme": "file-icons"
}
Host *
IdentityAgent "~/Library/Group Containers/2BUA8C4S2C.com.1password/t/agent.sock"
Host github.com
Hostname ssh.github.com
Port 443
User git
# https://stackoverflow.com/a/49398449/15548365
# code --list-extensions | xargs -L 1 echo code --install-extension
code --install-extension antfu.unocss
code --install-extension biomejs.biome
code --install-extension bradlc.vscode-tailwindcss
code --install-extension davidanson.vscode-markdownlint
code --install-extension dbaeumer.vscode-eslint
code --install-extension eamodio.gitlens
code --install-extension editorconfig.editorconfig
code --install-extension esbenp.prettier-vscode
code --install-extension github.copilot
code --install-extension github.copilot-chat
code --install-extension github.github-vscode-theme
code --install-extension github.vscode-github-actions
code --install-extension github.vscode-pull-request-github
code --install-extension hyoban.file-icons-continue
code --install-extension hyoban.tailwindcss-classname-highlight
code --install-extension johnsoncodehk.vscode-tsconfig-helper
code --install-extension johnsoncodehk.vscode-tsslint
code --install-extension mikestead.dotenv
code --install-extension naumovs.color-highlight
code --install-extension streetsidesoftware.code-spell-checker
code --install-extension usernamehw.errorlens
code --install-extension vue.volar
code --install-extension yutengjing.package-manager-enhancer
@hyoban
Copy link
Author

hyoban commented Jul 11, 2024

brew update && brew upgrade && brew autoremove && brew cleanup --prune=all

defaults write com.apple.dock ResetLaunchPad -bool true && killall Dock

@hyoban
Copy link
Author

hyoban commented Mar 2, 2025

sudo find 2>/dev/null /private/var/folders/ -type d -name com.apple.dock.launchpad -exec rm -rf {} +; killall Dock

https://www.reddit.com/r/mac/comments/1hfzakq/unable_to_reset_launchpad_using_terminal/?rdt=33626

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment