MD

michael-duren/dotfiles

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

0 stars 质量 45 趋势 8

个人点文件由GNU Stow管理。

概览

个人点文件由GNU Stow管理。 该仓库使用 GNU Stow 管理符号链接。所有 dotfile 均位于 dotfiles/package 目录中: - dotfiles/.config/nvim/ - Neovim 配置 - dotfiles/.config/tmux/ - Tmux 配置 - dotfiles/.config/ghostty/ - Ghostty 终端配置 - dotfiles/.config/hive/ - 蜂巢配置 - dotfiles/.config/zls.json - Zig 语言服务器配置 - dotfiles/.local/bin/ - 自定义脚本 - dotfiles/.zshrc - Zsh 配置(合并的 macOS/Linux 并检测操作系统) - dotfiles/.wezterm.lua - WezTerm 终端配置 - dotfiles/.ideavimrc - IntelliJ IDEA Vim 插件配置 - dotfiles/.vsvimrc - Visual Studio Vim 配置 这会安装 Oh My Zsh、Powerlevel10k 以及必需的 zsh 插件。 这样可以将所有dotfiles从dotfiles/目录的dotfiles链接到你的主目录。 GNU Stow 会从 dotfiles 仓库创建符号链接到你的主目录。例如: 该。

概述(AI 翻译)

个人点文件由GNU Stow管理。

结构

该仓库使用 GNU Stow 管理符号链接。所有点文件均位于 dotfiles/ 包目录中:

  • dotfiles/.config/nvim/ - Neovim 配置
  • dotfiles/.config/tmux/ - 多外形配置
  • dotfiles/.config/ghostty/ - 幽灵终端配置
  • dotfiles/.config/hive/ - 蜂巢配置
  • dotfiles/.config/zls.json - Zig语言服务器配置
  • dotfiles/.local/bin/ - 自定义脚本
  • dotfiles/.zshrc - Zsh配置(合并macOS/Linux与操作系统检测)
  • dotfiles/.wezterm.lua - WezTerm终端配置
  • dotfiles/.ideavimrc - IntelliJ IDEA Vim 插件配置
  • dotfiles/.vsvimrc - Visual Studio Vim 配置

先修条件

安装GNU Stow

macOS:

Linux(Debian/Ubuntu):

Linux(架构):

安装

  1. 克隆此仓库:

  2. (可选)安装Zsh依赖:

这会安装 Oh My Zsh、Powerlevel10k 以及必需的 zsh 插件。

  1. 删除已有冲突的配置:

  2. 使用 GNU 存储安装点文件:

这样可以将所有 dotfiles/ 目录中的点文件与你的主目录关联。

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

Dotfiles

Personal dotfiles managed with GNU Stow.

Structure

This repository uses GNU Stow to manage symlinks. All dotfiles are in the dotfiles/ package directory:

  • dotfiles/.config/nvim/ - Neovim configuration
  • dotfiles/.config/tmux/ - Tmux configuration
  • dotfiles/.config/ghostty/ - Ghostty terminal configuration
  • dotfiles/.config/hive/ - Hive configuration
  • dotfiles/.config/zls.json - Zig Language Server configuration
  • dotfiles/.local/bin/ - Custom scripts
  • dotfiles/.zshrc - Zsh configuration (merged macOS/Linux with OS detection)
  • dotfiles/.wezterm.lua - WezTerm terminal configuration
  • dotfiles/.ideavimrc - IntelliJ IDEA Vim plugin configuration
  • dotfiles/.vsvimrc - Visual Studio Vim configuration

Prerequisites

Install GNU Stow

macOS:

brew install stow

Linux (Debian/Ubuntu):

sudo apt install stow

Linux (Arch):

sudo pacman -S stow

Installation

  1. Clone this repository:

    git clone https://github.com/yourusername/dotfiles.git ~/Code/dotfiles
    cd ~/Code/dotfiles
    
  2. (Optional) Install Zsh dependencies:

    ./install-zsh-deps.sh
    

    This installs Oh My Zsh, Powerlevel10k, and required zsh plugins.

  3. Remove existing configs that conflict:

    # Backup your current configs if needed
    mv ~/.zshrc ~/.zshrc.backup
    rm ~/.config/nvim  # if it's a symlink
    # etc.
    
  4. Install dotfiles using GNU Stow:

    stow dotfiles
    

    This will symlink all dotfiles from the dotfiles/ directory to your home directory.

  5. Reload your shell:

    source ~/.zshrc
    

How GNU Stow Works

GNU Stow creates symlinks from the dotfiles repo to your home directory. For example:

~/Code/dotfiles/.config/nvim/init.lua  →  ~/.config/nvim/init.lua
~/Code/dotfiles/.zshrc                 →  ~/.zshrc
~/Code/dotfiles/.config/tmux/tmux.conf →  ~/.config/tmux/tmux.conf

Usage

Installing dotfiles

cd ~/Code/dotfiles
stow dotfiles

Removing dotfiles

cd ~/Code/dotfiles
stow -D dotfiles

Restowing (useful after updates)

cd ~/Code/dotfiles
stow -R dotfiles

Dry run (see what would happen)

stow -n dotfiles

Verbose output

stow -v dotfiles

Platform-Specific Notes

Zsh Configuration

The .zshrc file includes OS detection via $OSTYPE:

  • macOS-specific configs (Homebrew, Bun, Android Studio, etc.) only load on macOS
  • Shared configs (aliases, Go, vim, etc.) work on both platforms
  • Linux-specific configs can be added in the else branch

Local Overrides

Create ~/.zshrc.local for machine-specific configurations (API keys, local paths, etc.). This file is gitignored and sourced automatically.

Troubleshooting

Conflicts

If stow reports conflicts (files already exist), you have a few options:

在 GitHub 查看完整 README

推荐工具

换一个关键词,或者移除筛选条件。

安装

npx skillfish add michael-duren/dotfiles
新手?先看 mcpskill.org 教程 →