Skip to content

yangzhg/dotfiles

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dotfiles

Portable shell, Vim, and Git configuration for bootstrapping a new machine.

This repo keeps reusable defaults in version control and leaves identity, work-only aliases, private proxies, credentials, and machine-specific paths in local files that are not tracked.

Layout

  • home/.zshrc - portable Zsh and Oh My Zsh setup.
  • home/.bashrc and home/.bash_profile - portable Bash setup.
  • home/.shell_common - aliases, helpers, PATH, editor, and proxy helpers shared by Bash and Zsh.
  • home/.vimrc - Vim defaults with guarded optional plugins.
  • home/.gitconfig - Git defaults and aliases, with local identity included from ~/.gitconfig.local.
  • home/.config/git/ignore - global Git ignore patterns.
  • local/*.example - templates for private local overrides.
  • install.sh - backup and symlink installer.
  • Brewfile - base macOS Homebrew dependencies.
  • Brewfile.lang - optional language runtimes and formatters.

Vim

Vim uses vim-plug when ~/.vim/autoload/plug.vim exists. The default plugin set covers daily editing and multi-language development:

  • Git: vim-fugitive, vim-gitgutter
  • Editing: vim-surround, vim-repeat, vim-commentary, auto-pairs
  • Navigation: fzf.vim, nerdtree, tagbar
  • UI/syntax: lightline.vim, gruvbox, vim-polyglot
  • Project defaults: editorconfig-vim
  • LSP/completion: coc.nvim
  • Async lint/fix hooks: ale, configured conservatively

Default Coc extensions cover C/C++, CSS, Go, HTML, JSON, Python, Rust, shell, snippets, TypeScript/JavaScript, and YAML. ALE fixers are configured for common formatters such as black, isort, gofmt, rustfmt, shfmt, prettier, stylua, and clang-format.

Common mappings:

  • <leader>n - toggle file tree
  • <leader>f - find files
  • <leader>g - find Git-tracked files
  • <leader>b - switch buffers
  • <leader>t - toggle Tagbar
  • <leader>gs - open Fugitive Git status
  • <leader>af - run ALE fixer
  • gd / gr / K - definition, references, hover docs through Coc
  • <leader>h - clear search highlight

Shell Helpers

Common Bash/Zsh aliases live in home/.shell_common:

  • Navigation: .., ..., ...., -, mkcd
  • Listing and disk usage: ls, ll, la, l, lt, dfh, duh, dus
  • Editors and utilities: v, vi, py, serve, jqp, now
  • Git shell shortcuts: g, gst, ga, gaa, gc, gcm, gco, gsw, gsc, gd, gds, gl, gp, gpf, glg
  • Helpers: groot, activate, pathls, proxy_on, proxy_off, proxy_status

Install

Clone the repo, then run:

./install.sh --dry-run
./install.sh

To install common CLI dependencies, vim-plug, and Vim plugins:

./install.sh --with-deps

The base dependency set is intentionally limited to shell/editor utilities: Git, GitHub CLI, Vim, delta, eza, fzf, zoxide, jq, ripgrep, ctags, shellcheck, and shfmt.

Oh My Zsh is optional:

./install.sh --with-omz

Language runtimes and formatters are also optional, because tools such as Go and Node are often managed by version managers or project-specific toolchains:

./install.sh --with-langs

--with-langs installs the optional language toolchain layer: Node.js, Go, Python formatters, Prettier, clang-format, stylua, and a best-effort goimports install when go is available.

Options can be combined, for example:

./install.sh --with-deps --with-langs --with-omz

Dependency installation is OS-aware:

  • macOS: uses Homebrew and Brewfile.
  • Debian/Ubuntu: uses apt-get.
  • Fedora/RHEL family: uses dnf.
  • Arch family: uses pacman.

Linux package names vary by distribution, so the installer treats some language formatters and convenience tools as optional and warns when they are unavailable. Without --with-langs, Vim still starts normally, but Coc language servers and some ALE fixers may warn until the matching runtime or formatter is installed. See docs/dependencies.md for the full dependency split.

The installer backs up existing files as *.backup.YYYYmmddHHMMSS before linking dotfiles.

Local Overrides

Keep private configuration out of Git:

  • ~/.zshrc.local for machine-specific aliases, proxy URLs, private PATH entries, and work-only SSH hosts.
  • ~/.bashrc.local for Bash-specific local aliases and private shell setup.
  • ~/.gitconfig.local for user.name, user.email, internal URL rewrites, and credential helpers.

The installer creates example local files when they do not exist.

Secret Check

Before publishing:

./scripts/check-secrets.sh
git status --short

Review the output manually. Automated checks help, but they do not replace reading the diff before pushing a dotfiles repo.

About

Portable shell, Vim, and Git dotfiles

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors