Skip to content

Instantly share code, notes, and snippets.

@hyoban
Last active July 20, 2024 10:30
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 = hi@hyoban.cc
signingkey = /Users/hyoban/.ssh/id_ed25519.pub
[init]
defaultBranch = main
[core]
excludesfile = ~/.gitignore_global
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
# 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
)
if [[ $TERM_PROGRAM == "WarpTerminal" ]]; then
# https://starship.rs
# curl -sS https://starship.rs/install.sh | sh
eval "$(starship init zsh)"
source $ZSH/oh-my-zsh.sh
else
# 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
fi
# https://github.com/tj/n
# Added by n-install (see http://git.io/n-install-repo).
export N_PREFIX="$HOME/.n"; [[ :$PATH: == *":$N_PREFIX/bin:"* ]] || PATH+=":$N_PREFIX/bin"
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 rei="release-it"
alias re="nr release"
alias up='brew update && brew upgrade && brew autoremove && brew cleanup --prune=all && npm update -g'
alias uninstall='brew rm --zap -f --cask'
alias o='f(){ open -n -a "Google Chrome" --args --incognito "http://localhost:$@"; unset -f f; }; f'
alias od='open -n -a "Google Chrome" --args --incognito "http://localhost:5173"'
alias ll="ls -alh -D '%Y-%m-%dT%H:%M:%S'"
alias rlp="defaults write com.apple.dock ResetLaunchPad -bool true && killall Dock"
# -------------------------------- #
# Directories
#
# 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 -
}
{
// disable some built-in features
"breadcrumbs.enabled": false,
"editor.accessibilitySupport": "off",
"editor.bracketPairColorization.enabled": false,
"editor.guides.bracketPairs": "active",
"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,
// git related
"diffEditor.ignoreTrimWhitespace": false,
"diffEditor.experimental.showMoves": true,
"git.autofetch": true,
"git.confirmSync": false,
"git.enableSmartCommit": true,
"githubPullRequests.pullBranch": "never",
"gitlens.codeLens.enabled": false,
"gitlens.currentLine.enabled": false,
"gitlens.hovers.currentLine.over": "line",
"gitlens.hovers.enabled": false,
"gitlens.launchpad.indicator.enabled": false,
// animations
"editor.cursorBlinking": "smooth",
"editor.cursorSmoothCaretAnimation": "on",
"editor.smoothScrolling": true,
"workbench.list.smoothScrolling": true,
// appearance
"workbench.iconTheme": "file-icons",
"workbench.activityBar.location": "bottom",
"window.titleBarStyle": "native",
"window.customTitleBarVisibility": "never",
"apc.electron": {
"titleBarStyle": "hiddenInset",
"trafficLightPosition": {
"x": 7,
"y": 9
}
},
"apc.activityBar": {
"position": "bottom",
"size": 20
},
"apc.statusBar": {
"position": "editor-bottom",
"height": 35
},
"apc.stylesheet": {
"#workbench\\.parts\\.sidebar > div.composite.title > div.title-label > div": "display: none;"
},
"workbench.sideBar.location": "right",
"editor.lineNumbers": "off",
"[markdown]": {
"editor.wordWrap": "off"
},
"editor.fontFamily": "Monolisa Variable",
"editor.fontSize": 15,
"terminal.integrated.fontSize": 15,
"editor.fontVariations": true,
"editor.lineHeight": 25,
"editor.fontLigatures": "'ss02' on",
"editor.tokenColorCustomizations": {
"textMateRules": [
{
"scope": "comment",
"settings": {
"fontStyle": "italic"
}
}
]
},
"window.title": "${activeEditorLong}${separator}${rootName}",
"editor.renderWhitespace": "boundary",
"workbench.colorTheme": "Plastic - deprioritised punctuation",
"files.simpleDialog.enable": true,
"workbench.editor.limit.enabled": true,
"workbench.editor.limit.perEditorGroup": true,
"workbench.editor.limit.value": 5,
"zenMode.fullScreen": false,
// others
"files.readonlyFromPermissions": true,
"files.readonlyInclude": {
"**/node_modules/**": true,
"**/package-lock.json": true,
"**/pnpm-lock.yaml": true,
"**/yarn.lock": true
},
// extensions
"cSpell.diagnosticLevel": "Hint",
"errorLens.enabledDiagnosticLevels": ["error", "warning", "info", "hint"],
"errorLens.exclude": [
"^\".*\": Unknown word\\.$",
".* 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,
"iconify.inplace": false,
"tailwindCSS.colorDecorators": false,
"unocss.colorPreview": false,
"github.copilot.editor.enableCodeActions": false,
"markdownlint.config": {
"no-bare-urls": false,
"no-inline-html": false,
"fenced-code-language": false,
"no-duplicate-heading": false
},
"package-manager-enhancer.enablePackageJsonDependenciesCodeLens": false,
"github.copilot.enable": {
"*": true,
"plaintext": false,
"markdown": true,
"scminput": false
},
"prettier.semi": false,
"prettier.singleQuote": true,
"debug.onTaskErrors": "debugAnyway",
"tailwindcss-classname-highlight.enableHoverProvider": true,
"tailwindCSS.hovers": false,
"where-am-i.colorful": false
}
# https://stackoverflow.com/a/49398449/15548365
# code --list-extensions | xargs -L 1 echo code --install-extension
code --install-extension adpyke.vscode-sql-formatter
code --install-extension amodio.tsl-problem-matcher
code --install-extension antfu.goto-alias
code --install-extension antfu.iconify
code --install-extension antfu.open-in-github-button
code --install-extension antfu.slidev
code --install-extension antfu.theme-vitesse
code --install-extension antfu.unocss
code --install-extension antfu.where-am-i
code --install-extension ast-grep.ast-grep-vscode
code --install-extension astro-build.astro-vscode
code --install-extension biomejs.biome
code --install-extension bradlc.vscode-tailwindcss
code --install-extension connor4312.esbuild-problem-matchers
code --install-extension davidanson.vscode-markdownlint
code --install-extension dbaeumer.vscode-eslint
code --install-extension denoland.vscode-deno
code --install-extension dotjoshjohnson.xml
code --install-extension dprint.dprint
code --install-extension drcika.apc-extension
code --install-extension eamodio.gitlens
code --install-extension editorconfig.editorconfig
code --install-extension esbenp.prettier-vscode
code --install-extension fabiospampinato.vscode-open-in-github
code --install-extension file-icons.file-icons
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 humao.rest-client
code --install-extension hyoban.tailwindcss-classname-highlight
code --install-extension hyoban.xlog
code --install-extension johnsoncodehk.vscode-tsconfig-helper
code --install-extension kkopite.zhlint
code --install-extension kravets.vscode-publint
code --install-extension lokalise.i18n-ally
code --install-extension mathcale.theme-dracula-refined
code --install-extension mechatroner.rainbow-csv
code --install-extension ms-azuretools.vscode-docker
code --install-extension mxsdev.typescript-explorer
code --install-extension naumovs.color-highlight
code --install-extension prisma.prisma
code --install-extension simonsiefke.svg-preview
code --install-extension streetsidesoftware.code-spell-checker
code --install-extension tamasfe.even-better-toml
code --install-extension unifiedjs.vscode-mdx
code --install-extension usernamehw.errorlens
code --install-extension vitest.explorer
code --install-extension vue.volar
code --install-extension wayou.vscode-todo-highlight
code --install-extension will-stone.plastic
code --install-extension yoavbls.pretty-ts-errors
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

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