Skip to content

xavierforge/dotfiles

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

172 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Install

Clone to your home folder, then run the bootstrap script:

git clone https://github.com/xavierforge/dotfiles.git ~/dotfiles
cd ~/dotfiles
./install.sh

Make sure your login shell is zsh (echo $SHELL). If it isn't, switch with chsh -s "$(command -v zsh)" and reopen the terminal — otherwise .zshrc never loads. macOS already defaults to zsh; many Linux distros don't.

install.sh links every config with GNU Stow and, if Homebrew is present, installs the dependencies from the Brewfile. It never installs a package manager for you.

If Stow complains that a target already exists (e.g. you already have a ~/.zshrc), back up or remove that file first — Stow won't overwrite files it didn't create.

macOS

Install Homebrew once, then ./install.sh handles the rest (the Brewfile also pulls in Ghostty and the Nerd Font on macOS).

Linux

Homebrew is not required — install the tools with your native package manager first, then run ./install.sh (it will skip the Brewfile and just link configs):

# Debian/Ubuntu
sudo apt install stow git neovim tmux fzf ripgrep fd-find tree chafa zoxide
# Arch
sudo pacman -S stow git neovim tmux fzf ripgrep fd tree chafa zoxide

Notes:

  • stylua and uv aren't in most distro repos — install via cargo install stylua and the uv installer.
  • On Debian/Ubuntu the fd binary is named fdfind; symlink it so the fzf integration finds it: ln -s "$(command -v fdfind)" ~/.local/bin/fd.

Update

cd ~/dotfiles
git pull
./install.sh          # re-links new files + installs any new Brewfile deps

Other handy commands:

brew update && brew upgrade   # upgrade all Homebrew packages (macOS)
brew bundle cleanup           # list packages no longer in the Brewfile
                              #   add --force to actually uninstall them
stow --target ~/.config -D .  # unlink everything (reverse of install)

Tmux plugins (TPM)

Tmux plugins are managed by TPM and are not tracked in this repo. After the configs are linked, set it up once:

# 1. Clone TPM into the location tmux.conf expects
git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
  1. Start tmux, then press <prefix> + I (prefix is Ctrl + S) to install every plugin listed in tmux.conf. Use <prefix> + U to update them later.

Other tools

Keybindings

只列自己客製化的部分。LazyVim / Ghostty / Tmux 原生預設快捷鍵不重複列出。

Ghostty

Key Action
Cmd + C / Cmd + V Copy / Paste
Cmd + , Open config
Cmd + Shift + , Reload config
Cmd + Shift + O Toggle background opacity

Zsh

Key Action
jk (insert) Exit to normal mode (vi-mode)
Ctrl + P History search backward (prefix match)
Ctrl + N History search forward (prefix match)
t (command) Attach/create tmux session main

Tmux

Prefix 已從預設 Ctrl+B 改為 Ctrl + S。以下 <prefix> 代表按一次 prefix 後再按的鍵。

Key Action
<prefix> | Split pane 左右
<prefix> _ Split pane 上下
<prefix> h / j / k / l Resize pane(可連按)
<prefix> r Reload tmux.conf
<prefix> Ctrl + S Save session (tmux-resurrect)
<prefix> Ctrl + R Restore session (tmux-resurrect)
Ctrl + h / j / k / l Seamless 切換 vim/tmux 窗格 (vim-tmux-navigator)
v (copy-mode) Begin selection
y (copy-mode) Copy selection

Neovim

Leader 為 <space>(LazyVim 預設)。

General

Key Action
jk (insert) Exit insert mode
<leader>nh Clear search highlights

Windows / Splits

Key Action
<leader>sv Split vertical
<leader>sh Split horizontal
<leader>se Equalize splits
<leader>sx Close current split

Buffers (BufferLine)

Key Action
Tab Next buffer
Shift + Tab Previous buffer
Ctrl + P Pick buffer
<leader>X Close current buffer
<leader>A Close all buffers except current

Treesitter (incremental selection)

Key Action
S Start / expand selection
Backspace Shrink selection

Tests (Neotest)

Key Action
]n / [n Next / previous test
]N / [N Next / previous failed test

Rust (crates.nvim)

Key Action
<leader>cf Crate features popup
<leader>cd Crate dependencies popup
<leader>cH Open crate homepage
<leader>cG Open crate repository
<leader>cD Open crate documentation
<leader>cC Open on crates.io

About

My Configs and Dotfiles 🫥

Resources

Stars

12 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors