Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
e400f48
add vim navigation keys to the settings interface
Zaa3ter May 12, 2026
f286772
Fix reviw comments
Zaa3ter May 12, 2026
d9413e8
implement discussed keybinds
SuperCoolPencil May 13, 2026
cf26b69
feat: implement interactive bug report modal and add Vim-style naviga…
SuperCoolPencil May 13, 2026
002d97b
foundation for loading the keymaps
Zaa3ter May 14, 2026
4668715
feat: keymaps JSON config in SurgeDir for Customizing the keys functi…
Zaa3ter May 14, 2026
f4c38d3
resolve: remove the log file and the unnecessary saving for the file.
Zaa3ter May 14, 2026
d7337e4
resolve: add todo to display all the keymaps in the help
Zaa3ter May 14, 2026
e71bc60
fix: recreate the keymap file when there and err of parsing it
Zaa3ter May 14, 2026
8fac309
Merge branch 'keymaps-config-file' into setting-binding (resolving co…
SuperCoolPencil May 18, 2026
bb32b10
docs/refactor: update SETTINGS.md for keymap.json config and fix lint…
SuperCoolPencil May 18, 2026
db22912
fix(tui): remove shadowed l and h keys from Dashboard NextTab and Pre…
SuperCoolPencil May 18, 2026
8677b22
fix(tui): clean up ReportBug help text representation and add robust …
SuperCoolPencil May 18, 2026
ccb9c1a
feat: implement dynamic keymap hot-reloading from disk and add "/" as…
SuperCoolPencil May 18, 2026
607e2c8
fix: update keymap modification timestamp and resolve struct field va…
SuperCoolPencil May 18, 2026
4860ae5
refactor: update default dashboard keybindings to include vim-style n…
SuperCoolPencil May 18, 2026
93a8db7
fix: improve health check logic, bitmap safety, TUI config loading, a…
SuperCoolPencil May 18, 2026
eba34cc
chore: skip dynamic keymap tests on Windows and validate defaults dur…
SuperCoolPencil May 18, 2026
e489b08
merge: resolve conflicts with origin/main and consolidate config conv…
SuperCoolPencil May 18, 2026
cb21ad2
chore: format files using go fmt
SuperCoolPencil May 18, 2026
cec8c74
refactor: remove redundant bitmap size validation in progress type up…
SuperCoolPencil May 18, 2026
5da3bda
feat(tui): add vim-style h/j/k/l settings navigation and fix keymap h…
SuperCoolPencil May 18, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 45 additions & 1 deletion docs/SETTINGS.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,58 @@ Surge implements a self-healing configuration system to ensure the application r
- **Syntactic Validation**: Proxy URLs and DNS server lists are validated for correct syntax.
- **Category Integrity**: If a custom category has an invalid regular expression pattern, it is automatically pruned from the active list to prevent engine crashes.
- **Corrupt JSON Fallback**: If the `settings.json` file is completely unparseable (e.g., missing brackets or commas), Surge will log a warning and start with all factory default settings for that session.
## Keymap Configuration

Surge allows you to customize your keyboard shortcuts by editing the `keymap.json` file located in the application config directory:

- **Windows:** `%APPDATA%\surge\keymap.json`
- **macOS:** `~/Library/Application Support/surge/keymap.json`
- **Linux:** `~/.config/surge/keymap.json`

Surge will automatically generate this file with all default keybindings (including Vim-style keys) on the first startup.

### Structure

The `keymap.json` file is structured into nested sections matching each TUI state (e.g., `dashboard`, `settings`, `file_picker`, etc.). Each binding consists of an array of key strings and a help description. For example:

```json
{
"dashboard": {
"Quit": {
"keys": [
"ctrl+c",
"ctrl+q"
],
"help": "quit"
},
"Up": {
"keys": [
"up",
"k"
],
"help": "up"
}
}
}
```

*Note: You do not need to specify all keys. Surge will automatically validate and fall back to internal defaults for any missing or invalid keybindings on startup.*

### Ambiguous Bindings & ForceQuit

By default, both `Quit` and `ForceQuit` in the dashboard bind `ctrl+c`.
- **Quit** (`ctrl+c` or `ctrl+q`) initiates a graceful shutdown of all active download tasks, ensuring that progress and state are fully persisted before exiting the application.
- **ForceQuit** (`ctrl+c`) performs an immediate exit of the application without waiting for the graceful shutdown of the background download engine.

If you choose to customize these bindings, you can separate them (e.g. binding `Quit` exclusively to `ctrl+q` and `ForceQuit` exclusively to `ctrl+c`) to avoid any ambiguity during normal exit.

## Directory Structure

Surge follows OS conventions for storing its files. Below is a breakdown of every directory it uses and where to find it on each platform.

| Directory | Purpose | Linux | macOS | Windows |
| :---------- | :-------------------------------- | :--------------------------- | :------------------------------------------ | :---------------------- |
| **Config** | `settings.json` | `~/.config/surge/` | `~/Library/Application Support/surge/` | `%APPDATA%\surge\` |
| **Config** | `settings.json`, `keymap.json` | `~/.config/surge/` | `~/Library/Application Support/surge/` | `%APPDATA%\surge\` |
| **State** | Database (`surge.db`), auth token | `~/.local/state/surge/` | `~/Library/Application Support/surge/` | `%APPDATA%\surge\` |
| **Logs** | Timestamped `.log` files | `~/.local/state/surge/logs/` | `~/Library/Application Support/surge/logs/` | `%APPDATA%\surge\logs\` |
| **Themes** | Custom `.toml` theme files | `~/.config/surge/themes/` | `~/Library/Application Support/surge/themes/` | `%APPDATA%\surge\themes\` |
Expand Down
Loading
Loading