关于
My dotfiles, install scripts, and tools for macOS, Linux, and WSL. Pilfer at your own peril.
开发工具实测星标增长
- 24小时
- 0
- 7天
- +1
- 15天
- +1
- 1个月
- 正在收集历史
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文Unix/Linux dotfiles, scripts, and stuff
Pilfer at your own peril. If you are thinking of following, just know I commit to main about once every three days, if I had several commits I will put them in a draft PR to avoid blowing followers away with commit notifications.
Don't forget to install fonts as well if you want to use everything in here.
What's here
| Directory | What it is |
|---|---|
config/ |
Configuration, one directory per tool (bash, vim, tmux, git, ...), most with a setup |
install/ |
install-* scripts that install tools (mac, ubuntu, redhat, windows) |
bin/ |
Small standalone commands, indexed in bin/README.md; the bashrc setup adds them to your PATH automatically |
Nothing in the repo is a hidden file. Files like config/bash/bashrc are plain names so they show up in ls, and each tool's setup script creates the dotted symlink in $HOME (~/.bashrc, ~/.tmux.conf, ...).
To link everything into place run ./setup from the repo root. A tool whose setup fails (usually because the tool is not installed) is reported at the end and never stops the others. To set up just one tool run ./setup inside its directory, for example config/vim/setup.
These are not part of ./setup: cowsay, fortunes and obs are just files to use or copy.
Where things live
bashrcfinds this repo through$DOTFILESand puts$DOTFILES/binon yourPATH. Nothing depends on a~/Scriptsdirectory or a$SCRIPTSvariable.- Under WSL2,
bashrcdrops the Windows folders fromPATH, because searching them made shells and prompts slow. Windows commands are rarely needed here, so each one is added explicitly byconfig/wsl/setup. See why. - Machine-specific values (
GITUSER,DOTFILES,TZ) are written once byconfig/bash/setupto~/.config/dot/env, which is never committed. Git identity and signing keys are set byconfig/git/setupinto your untracked~/.gitconfig. - Author-specific bash settings live in
config/bash/personal. Fork the repo and edit that file to make it yours;bashrcstays generic. - Repositories are expected under lowercase
~/repos(~/repos/github.com/<user>/dot), andCDPATHis never used anywhere.
Operating system preference
Everything in this repo will work on any Unix or Linux system once the dependencies are satisfied. As for host workstation operating systems I personally prefer the following in order:
- macOS (Unix)
- WSL2 with
wslu(Linux) - Linux Mint Cinnamon
Note that much of this repo content will also work with Git-Bash, Cygwin, and MinGW but not all.
When I use Windows, it is with one of two setups:
- VS Code with Git Bash
- WSL2 running Ubuntu, so the Ubuntu install scripts and the configurations in
config/apply, with WezTerm installed on Windows and opening Bash in WSL (seeconfig/wezterm)
Under WSL2, config/wsl/setup copies wslconfig to %USERPROFILE%\.wslconfig, which turns on mirrored networking (Windows 11 22H2 or later) so localhost works in both directions. An existing file that differs is backed up and replaced. Apply changes with wsl --shutdown, which stops everything running in WSL; read why and what to expect first.
Core dependencies
Before running any install-* script make sure the system has:
/bin/sh(POSIX 2018, noksh-isms)/usr/bin/perl(v5.26 which moderngitdepends on)gitcurluname
Note that perl—required for any git install—is used more efficiently and powerfully than any of the usual handicapped alternatives: sed, awk, grep, head, tail, cut, tr, etc.
In true Unix fashion, many of the scripts in bin/ depend on one another and on the tools the install-* scripts provide.
Installing tools
On macOS, install/mac/install-most-stuff-with-brew installs most of what the config expects with Homebrew. On Ubuntu, install/ubuntu/install-most-stuff-with-apt does the same, and the other install-* scripts there install a single tool from its latest official release, usually by way of gh release download or go install.
Scripts over functions and aliases
Even a one-line script works anywhere: as a Vim filter, pipeline text transformation, and interactive command. Functions cannot be called universally from other executables. In fact, the only time a function should ever be used is when the state of the current shell needs to change, such as changing the current working directory (see the clone and cdd functions in config/bash/bashrc).
Aliases are nice to same typing on the command line, but that is the only place they should ever be used. Very often an alias is better as a one-line script.
The cdd function
cdd NAME changes into the first directory called NAME (or whose name contains it, ignoring case) found below the roots in $CDD, a PATH-like list set in config/bash/personal. It is a function because only a function can change your directory, and unlike CDPATH it never changes plain cd, so scripts are unaffected. Hits are cached; cdd -f NAME searches again. See the comment above cdd in bashrc for the details.
Checking changes
Run ./check before committing. It changes nothing and checks shell syntax, shellcheck errors, Markdown (with rumdl) and a few repo rules, such as every script in bin/ having a row in its index. It needs shellcheck and rumdl.
More info
Have questions about any of this? Come ask them on my Twitch live stream, or watch my videos, which you can search in my videos repo.
探索相关项目
加载中…