initial commit [141.14.140.180,mike]
This commit is contained in:
commit
156bb18c91
50 files changed
+13466
No files matched your search
@@ -0,0 +1,199 @@
|
||||
<h1 align="center">👻 ghosttyconf</h1>
|
||||
|
||||
<p align="center">
|
||||
<b>A terminal editor for the <a href="https://ghostty.org">Ghostty</a> configuration.</b><br>
|
||||
Browse, search and edit every option, with the full documentation next to it.
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
<img alt="Go 1.24+" src="https://img.shields.io/badge/go-1.24%2B-00ADD8?logo=go&logoColor=white">
|
||||
<img alt="Ghostty 1.3" src="https://img.shields.io/badge/ghostty-1.3-7aa2f7">
|
||||
<img alt="macOS and Linux" src="https://img.shields.io/badge/platform-macOS%20%7C%20Linux-a6adc8">
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
<img src="docs/images/main.svg" alt="ghosttyconf: categories, options and documentation" width="100%">
|
||||
</p>
|
||||
|
||||
Ghostty is configured with a plain text file and close to two hundred options.
|
||||
ghosttyconf puts all of them on one screen. It groups the options into
|
||||
categories and shows each one's type, default and current value. Every option
|
||||
gets the editor that fits it. Comments, blank lines and the order of your file
|
||||
stay intact, and after saving, Ghostty reloads the configuration right away.
|
||||
|
||||
---
|
||||
|
||||
## ✨ Highlights
|
||||
|
||||
- 📚 **All options, documented.** All 201 options of Ghostty 1.3, in 19
|
||||
categories, with the documentation of *your* Ghostty version.
|
||||
- 🎛 **An editor for every type.** Toggles, choice lists, checklists for flags,
|
||||
number steppers, colors with live swatches, a list editor for repeatable
|
||||
options, the 256-color palette.
|
||||
- 🎨 **Theme and font pickers.** Filter more than 460 themes with a live color
|
||||
preview, or pick from the font families Ghostty can find.
|
||||
- ⌨️ **Key binding editor.** See Ghostty's built-in bindings merged with yours,
|
||||
and change, unbind, restore or add bindings. Record shortcuts straight from
|
||||
the keyboard.
|
||||
- 🧷 **Your file stays yours.** Comments, blank lines and the order of
|
||||
untouched lines are kept, and changed entries are rewritten in place.
|
||||
- ✅ **Safe saving.** `ghostty +validate-config` checks every save first. The
|
||||
old file is kept as a backup, writes are atomic, and symlinks into dotfile
|
||||
repositories keep working.
|
||||
- 🔄 **Instant apply.** After saving, the running Ghostty reloads its
|
||||
configuration.
|
||||
- 🔎 **Search, undo, diff.** Search names and documentation, undo step by step,
|
||||
and review all unsaved changes before you save.
|
||||
|
||||
## 🚀 Installation
|
||||
|
||||
You need [Go](https://go.dev/dl/) 1.24 or newer and Ghostty.
|
||||
|
||||
```sh
|
||||
git clone https://git.micw.org/mike/ghosttyconf.git
|
||||
cd ghosttyconf
|
||||
make install # installs ghosttyconf into $(go env GOPATH)/bin
|
||||
```
|
||||
|
||||
`make build` builds `./ghosttyconf` in the source directory instead.
|
||||
|
||||
## 💡 Quick start
|
||||
|
||||
```sh
|
||||
ghosttyconf
|
||||
```
|
||||
|
||||
This opens the config file Ghostty itself would load. Pick a category on the
|
||||
left and an option on the right, then press `enter` to edit it. Changes are
|
||||
marked yellow until you save them with `ctrl+s`. Press `?` for help at any time.
|
||||
|
||||
```sh
|
||||
ghosttyconf ~/dotfiles/ghostty/config # edit a specific file
|
||||
ghosttyconf --print-path # which file would be edited?
|
||||
```
|
||||
|
||||
## 🎨 Themes with a live preview
|
||||
|
||||
Editing `theme` opens a picker over all themes Ghostty ships plus your own.
|
||||
Type to filter. The preview shows the highlighted theme's colors before you
|
||||
commit to it, and a note tells you which of your own color settings override
|
||||
the theme.
|
||||
|
||||
<p align="center"><img src="docs/images/picker.svg" alt="Theme picker with preview" width="100%"></p>
|
||||
|
||||
Fonts work the same way: `font-family` and its bold/italic variants list the
|
||||
families reported by `ghostty +list-fonts`.
|
||||
|
||||
## ⌨️ Key bindings
|
||||
|
||||
Press `b` to open the key binding editor. It shows every binding that is
|
||||
*active*: Ghostty's built-in defaults merged with the entries in your file.
|
||||
Each one is marked `default`, `changed`, `custom` or `unbound`.
|
||||
|
||||
<p align="center"><img src="docs/images/keybinds.svg" alt="Key binding editor" width="100%"></p>
|
||||
|
||||
- **Change any binding**, including built-in ones. Give it another key or
|
||||
another action.
|
||||
- **Unbind** (`d`) a key, **restore** (`r`) Ghostty's default, or **add**
|
||||
(`a`) a new binding.
|
||||
- **Filter** (`/`) by key, action or description. Searching `cmd+d` finds
|
||||
`super+d`. Press `c` to show only your changes.
|
||||
- See the **documentation of every action** with its parameters, and every
|
||||
key that is bound to it.
|
||||
|
||||
The editor writes the smallest possible set of entries. Moving `new_split:right`
|
||||
from `super+d` to `super+\` becomes
|
||||
|
||||
```ini
|
||||
keybind = super+d=unbind
|
||||
keybind = super+\=new_split:right
|
||||
```
|
||||
|
||||
A binding set back to Ghostty's default disappears from your file again.
|
||||
|
||||
### 🔴 Recording shortcuts
|
||||
|
||||
In the binding form, press `ctrl+r` and then the shortcut. ghosttyconf turns on
|
||||
the kitty keyboard protocol while it records, so `⌘`/super combinations arrive
|
||||
too. Several combinations in a row record a sequence such as `ctrl+a>n`. A
|
||||
warning appears if the key already does something else.
|
||||
|
||||
<p align="center"><img src="docs/images/record.svg" alt="Recording a key combination" width="100%"></p>
|
||||
|
||||
## 💾 Saving and reloading
|
||||
|
||||
`ctrl+s` saves, and `c` shows what is about to change:
|
||||
|
||||
<p align="center"><img src="docs/images/changes.svg" alt="Unsaved changes" width="100%"></p>
|
||||
|
||||
Every save runs these steps:
|
||||
|
||||
1. **Validate.** The new file is checked with `ghostty +validate-config`. If
|
||||
Ghostty complains, you see its messages and can go back or save anyway.
|
||||
2. **Check the disk.** If another program changed the file since it was
|
||||
loaded, you are asked before anything is overwritten.
|
||||
3. **Back up.** The first save of a session keeps the previous version as
|
||||
`config.ghostty.bak`.
|
||||
4. **Write atomically.** The file is written through a temporary file, so it
|
||||
is never half-written. Symlinks are followed and permissions kept.
|
||||
5. **Reload.** The running Ghostty reloads its configuration, just like
|
||||
`⌘⇧,` / `ctrl+shift+,`.
|
||||
|
||||
| Platform | How the reload works |
|
||||
| --- | --- |
|
||||
| macOS | Ghostty's AppleScript command `perform action "reload_config"` (needs `macos-applescript = true`, the default) |
|
||||
| Linux | `SIGUSR2` to your Ghostty processes, which the GTK app handles as a reload |
|
||||
|
||||
Pass `--no-reload` to only save.
|
||||
|
||||
## 🧭 Keys
|
||||
|
||||
| Key | Action |
|
||||
| --- | --- |
|
||||
| `↑` `↓` / `j` `k` | move |
|
||||
| `←` `→` / `tab` | switch between categories and options |
|
||||
| `enter` | edit the selected option |
|
||||
| `space` | toggle a boolean / cycle a choice |
|
||||
| `+` `-` | increase / decrease a number |
|
||||
| `r` / `del` | reset to the default (removes the line) |
|
||||
| `/` | search option names and documentation |
|
||||
| `b` | key binding editor |
|
||||
| `shift+↑` `shift+↓` | scroll the documentation |
|
||||
| `u` / `ctrl+z` | undo |
|
||||
| `c` | show unsaved changes |
|
||||
| `p` | hide options for other platforms |
|
||||
| `ctrl+s` | validate, save and reload |
|
||||
| `?` | help |
|
||||
| `q` | quit |
|
||||
|
||||
The mouse works too: click to select, click again to edit, and scroll with the
|
||||
wheel. The [user guide](docs/guide.md) lists the keys of every editor.
|
||||
|
||||
## ⚙️ Command line
|
||||
|
||||
```text
|
||||
ghosttyconf [flags] [config-file]
|
||||
|
||||
--config <file> config file to edit (default: the one Ghostty loads)
|
||||
--ghostty <path> ghostty binary (default: $PATH, then /Applications)
|
||||
--no-reload do not reload Ghostty after saving
|
||||
--offline do not run ghostty; use the built-in option list
|
||||
--print-path print the config file that would be edited and exit
|
||||
```
|
||||
|
||||
## 🔧 How it works
|
||||
|
||||
The list of options, their types, enum values and flags is generated from
|
||||
Ghostty's source (`src/config/Config.zig`) and built into the binary. At
|
||||
startup, ghosttyconf asks the installed Ghostty for its documentation and
|
||||
defaults (`ghostty +show-config --default --docs`), so the text always matches
|
||||
your version. Themes, fonts, actions and validation also come from the
|
||||
`ghostty` command line. Without Ghostty (`--offline`), the built-in data is
|
||||
used.
|
||||
|
||||
## 📖 Documentation
|
||||
|
||||
- [User guide](docs/guide.md): every editor, key bindings in depth, saving,
|
||||
reloading, troubleshooting
|
||||
- [Development](docs/development.md): project layout, the schema generator,
|
||||
tests and screenshots
|
||||
Reference in new issue
Block a user