# Configure Skink: settings.json and bindings.json

> Where Skink's config lives, how to edit settings.json and bindings.json in Micro's format, the main settings and defaults, and how to bring over a Micro config.

Source: https://skink.cc/customize/configuration/

Skink keeps its config in two JSON files in `~/.config/skink`: `settings.json` for options and `bindings.json` for keys. Run `:settings` or `:bindings` to open one in a tab, edit, save with Ctrl+S, then run `:reload`.

A missing file is created with defaults when you open it.

Both files use Micro's format, so a Micro config mostly works as it is.

## Where the files live

| OS | Folder |
|---|---|
| Linux, macOS | `$XDG_CONFIG_HOME/skink`, else `~/.config/skink` |
| Windows | `%APPDATA%\skink` |
| Any | `$SKINK_CONFIG_DIR` if set, overrides the above |

`SKINK_CONFIG_DIR` is handy for trying a config without touching your real one:

```sh
SKINK_CONFIG_DIR=/tmp/skink-test skink .
```

### Comments and mistakes are fine

Both files accept `//` and `/* */` comments and trailing commas, so you do not have to be strict about JSON.

Unknown keys are ignored. A bad value falls back to the default, and `:reload` tells you what was wrong.

## settings.json

A small example:

```jsonc
{
  "tabsize": 2,
  "tabstospaces": true,
  "rulers": [80, 100],
  "formatonsave": true,
  // no blame text at the end of the line
  "inlineblame": false,
}
```

### Main settings

| Setting | Default | What it does |
|---|---|---|
| `tabsize` | `4` | Width of a tab, 1 to 16 |
| `tabstospaces` | `false` | Indent with spaces in files with no indentation yet (otherwise the file's own style is detected) |
| `autoclose` | `true` | Close brackets and quotes as you type |
| `syntax` | `true` | tree-sitter syntax colours |
| `indentguides` | `true` | Vertical indent guides |
| `icons` | `"auto"` | `"auto"`, `"nerd"` or `"ascii"` |
| `rulers` | `[]` | Columns to mark with a line, e.g. `[80, 100]`. Micro's `colorcolumn` works too |
| `stickyscroll` | `true` | Keep the headers of the blocks you are in at the top |
| `autocomplete` | `true` | Open the completion list while typing (Ctrl+Space always works) |
| `formatonsave` | `false` | Ask the language server to format on every save |
| `inlayhints` | `false` | Show the language server's type and parameter hints |
| `gitgutter` | `true` | Git change marks next to the line numbers |
| `inlineblame` | `true` | Faded blame at the end of the cursor line |
| `restoresession` | `true` | `skink` with no arguments in a project reopens its last session |
| `macoptionisalt` | `"auto"` | macOS Option key handling: `"auto"`, `"always"` or `"never"` (see [macOS Option key](https://skink.cc/customize/macos-option-key/)) |
| `updates` | `"notify"` | `"notify"`, `"auto"` or `"off"` (see [Install](https://skink.cc/start/install/)) |
| `ai.agent` | `"auto"` | Which ACP agent to use, by name or as a command list |
| `ai.model` | `"default"` | Model to ask the agent for |
| `ai.effort` | `"default"` | `"low"`, `"medium"`, `"high"` or `"max"` |

`ai.model.MODE` and `ai.effort.MODE` override the model and effort per prompt-box mode (`rewrite`, `ask`, `search`, `implement`). The AI settings are explained in [AI agents](https://skink.cc/tools/ai-agents/).

### Line endings

Line endings are per file, not a setting. `:set eol=lf` or `:set eol=crlf` changes them on the next save.

## bindings.json

`bindings.json` maps a key name to an action, exactly like Micro:

```json
{
  "Ctrl-j": "Save",
  "Alt-g": "command-edit:goto ",
  "F7": "ToggleZoom"
}
```

Your entries are added on top of the defaults. `:reload` rebuilds the key map from the defaults plus your file, so a binding you delete really goes away.

If a key name is not understood, `:reload` reports `bindings.json: unknown key …`.

**A key that never arrives:**
If your terminal, tmux or keyboard layout swallows a key, you don't have to rebind it. Every key also has a typed command: press Ctrl+E and type it. See [Every key has a typed command](https://skink.cc/editing/typed-commands/).

### Key names

- Modifiers: `Ctrl-`, `Alt-`, `Shift-`, combined like `CtrlShift-d` or `Alt-CtrlUp`. The dash is optional: `CtrlHome`, `ShiftF12` and `Ctrl-q` all work.
- Keys: letters and symbols (`Ctrl-/`, `Alt-.`), `Up`, `Down`, `Left`, `Right`, `Home`, `End`, `PageUp`, `PageDown`, `Enter`, `Tab`, `Backtab` (Shift-Tab), `Backspace`, `Delete`, `Insert`, `Esc`, `Space`, `F1` to `F20`.
- With `Alt`, an uppercase letter in `bindings.json` means Shift too: `"Alt-G"` is Alt+Shift+G, `"Alt-g"` is Alt+G. This is Micro's notation; the rest of these docs write keys as you press them.

### Chaining actions

| Value | Meaning |
|---|---|
| `"Copy\|CopyLine"` | Run the first action that works (copy the selection, else the line) |
| `"Escape,Deselect"` | Run both, in order |
| `"command-edit:goto "` | Open the command line pre-filled with `goto ` |
| `"command-edit:"` | Open an empty command line (the default Ctrl+E) |

### Action names

Action names are Micro's where Skink has the same feature (`Save`, `SpawnMultiCursor`, `ToggleMacro`), plus Skink's own (`QuickOpen`, `ToggleTerminal`, `RenameSymbol`).

- The full list is in the [manual](https://skink.cc/reference/manual/).
- The default keys are in [Keyboard shortcuts](https://skink.cc/reference/shortcuts/).
- More examples and terminal caveats: [Key bindings](https://skink.cc/customize/keybindings/).

## Coming from Micro

Copy your Micro files over:

```sh
mkdir -p ~/.config/skink
cp ~/.config/micro/bindings.json ~/.config/skink/
cp ~/.config/micro/settings.json ~/.config/skink/
```

### What carries over

- Key bindings with Micro's key names and action names, including `|` and `,` chains.
- `tabsize`, `tabstospaces`, `autoclose`, `syntax` and `colorcolumn` (as a ruler).

### What does not

- Settings Skink does not have are ignored silently, so they do no harm.
- Bindings to actions Skink does not have will not work. Micro's `command:` prefix is not supported; use `command-edit:` instead.
- Micro colorschemes and Lua plugins. Skink has one built-in theme (Tokyo Night) and no plugins yet.

**Note:**
Skink is alpha. Themes and scripting are planned but not in yet.

## Applying changes

1. Run `:settings` or `:bindings` to open the file.
2. Edit it and save with Ctrl+S.
3. Run `:reload` to apply settings and bindings.

Saving a change to `ai.agent`, `ai.model` or `ai.effort` also tests the agent with a one-line chat and reports the result.

`:settings` puts a reference of agents, models and effort levels at the top of the file.
