> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/sinelaw/fresh/llms.txt
> Use this file to discover all available pages before exploring further.

# Configuration Overview

> Learn how to configure Fresh text editor through config.json and customize your editing experience

## Configuration File Location

Fresh stores its configuration in a JSON file located at:

```bash theme={null}
~/.config/fresh/config.json
```

The configuration file controls all aspects of the editor including themes, keybindings, editor behavior, language settings, and LSP servers.

## Configuration Structure

The configuration file is organized into these main sections:

<CardGroup cols={2}>
  <Card title="Editor Settings" icon="pencil" href="/configuration/settings">
    Tab size, line numbers, syntax highlighting, auto-save, and display options
  </Card>

  <Card title="Keyboard & Keymaps" icon="keyboard" href="/configuration/keyboard">
    Keybinding styles (default, emacs, vscode, macos) and custom key mappings
  </Card>

  <Card title="Themes" icon="palette" href="/configuration/themes">
    Built-in themes and color customization
  </Card>

  <Card title="Language Settings" icon="code">
    Per-language configuration for formatters, LSP servers, and indentation
  </Card>
</CardGroup>

## Example Configuration

Here's a minimal configuration file:

```json config.json theme={null}
{
  "theme": "high-contrast",
  "check_for_updates": true,
  "active_keybinding_map": "default",
  "editor": {
    "tab_size": 4,
    "line_numbers": true,
    "line_wrap": true,
    "syntax_highlighting": true,
    "auto_indent": true
  }
}
```

## Opening the Settings Editor

Fresh provides a visual settings editor for easy configuration:

<Steps>
  <Step title="Open Settings">
    Press `Ctrl+,` or use the command palette (`Ctrl+P`) and type `>settings`
  </Step>

  <Step title="Browse Settings">
    Settings are organized by category: Display, Editing, LSP, Performance, etc.
  </Step>

  <Step title="Edit Values">
    Click on any setting to modify it. Changes are saved automatically to `config.json`
  </Step>
</Steps>

## Configuration Categories

### Top-Level Settings

| Setting                 | Type           | Default                        | Description                                       |
| ----------------------- | -------------- | ------------------------------ | ------------------------------------------------- |
| `theme`                 | string         | `"high-contrast"`              | Active color theme name                           |
| `locale`                | string \| null | `null`                         | UI language (null = auto-detect from environment) |
| `check_for_updates`     | boolean        | `true`                         | Check for new versions on startup                 |
| `active_keybinding_map` | string         | `"default"` (macOS: `"macos"`) | Active keybinding map                             |

### Editor Configuration

The `editor` object controls editing behavior, display settings, LSP features, and performance:

```json theme={null}
{
  "editor": {
    "tab_size": 4,
    "auto_indent": true,
    "line_numbers": true,
    "line_wrap": true,
    "syntax_highlighting": true,
    "enable_inlay_hints": true,
    "auto_save_enabled": false,
    "auto_save_interval_secs": 30
  }
}
```

See [Settings Reference](/configuration/settings) for all available options.

### File Explorer

Configure the file tree sidebar:

```json theme={null}
{
  "file_explorer": {
    "respect_gitignore": true,
    "show_hidden": false,
    "show_gitignored": false,
    "width": 0.3
  }
}
```

### Clipboard

Control which clipboard methods are used:

```json theme={null}
{
  "clipboard": {
    "use_osc52": true,
    "use_system_clipboard": true
  }
}
```

<Note>
  If you experience clipboard hangs in certain terminals (like PuTTY), disable `use_osc52`.
</Note>

### Terminal

Configure integrated terminal behavior:

```json theme={null}
{
  "terminal": {
    "jump_to_end_on_output": true
  }
}
```

## Language-Specific Configuration

Override settings per language:

```json theme={null}
{
  "languages": {
    "rust": {
      "tab_size": 4,
      "use_tabs": false,
      "formatter": {
        "command": "rustfmt",
        "args": [],
        "stdin": true
      },
      "format_on_save": true
    },
    "go": {
      "tab_size": 8,
      "use_tabs": true,
      "show_whitespace_tabs": false
    }
  }
}
```

### Language Configuration Options

| Option           | Type      | Description                                   |
| ---------------- | --------- | --------------------------------------------- |
| `extensions`     | string\[] | File extensions (e.g., `["rs"]`)              |
| `filenames`      | string\[] | Exact filename matches (e.g., `["Makefile"]`) |
| `grammar`        | string    | Tree-sitter grammar name                      |
| `comment_prefix` | string    | Comment syntax (e.g., `"//"`)                 |
| `tab_size`       | number    | Spaces per tab (overrides global)             |
| `use_tabs`       | boolean   | Insert tab characters instead of spaces       |
| `auto_indent`    | boolean   | Auto-indent new lines                         |
| `formatter`      | object    | Formatter configuration                       |
| `format_on_save` | boolean   | Run formatter on save                         |

## LSP Server Configuration

Configure language servers:

```json theme={null}
{
  "lsp": {
    "rust": {
      "command": "rust-analyzer",
      "args": [],
      "enabled": true,
      "auto_start": false,
      "process_limits": {
        "max_memory_percent": 50,
        "max_cpu_percent": 90,
        "enabled": true
      },
      "initialization_options": {
        "checkOnSave": false,
        "diagnostics": {"enable": true}
      }
    }
  }
}
```

### LSP Configuration Options

| Option                   | Type      | Description                                   |
| ------------------------ | --------- | --------------------------------------------- |
| `command`                | string    | LSP server executable                         |
| `args`                   | string\[] | Command-line arguments                        |
| `enabled`                | boolean   | Enable this language server                   |
| `auto_start`             | boolean   | Start server automatically when opening files |
| `initialization_options` | object    | Server-specific initialization options        |
| `process_limits`         | object    | Memory and CPU limits                         |

## Reloading Configuration

Fresh automatically reloads `config.json` when it changes. You can also:

* **Restart the editor**: Changes take effect immediately
* **Use the settings UI**: Changes are applied in real-time
* **Reload manually**: `>reload config` in the command palette

## Configuration Schema

Fresh provides JSON schema validation for `config.json`. Enable schema validation in your editor:

```json config.json theme={null}
{
  "$schema": "/path/to/fresh/plugins/config-schema.json"
}
```

## Migration

Fresh supports configuration migrations through the `version` field:

```json theme={null}
{
  "version": 0,
  "theme": "high-contrast"
}
```

Configurations without a `version` field are treated as version 0.

## Example: Complete Configuration

<AccordionGroup>
  <Accordion title="View complete config.example.json">
    ```json theme={null}
    {
      "theme": "high-contrast",
      "check_for_updates": true,
      "editor": {
        "tab_size": 4,
        "auto_indent": true,
        "line_numbers": true,
        "relative_line_numbers": false,
        "scroll_offset": 3,
        "syntax_highlighting": true,
        "line_wrap": true,
        "highlight_timeout_ms": 5,
        "snapshot_interval": 100,
        "large_file_threshold_bytes": 1048576,
        "estimated_line_length": 80,
        "enable_inlay_hints": true,
        "enable_semantic_tokens_full": false,
        "auto_save_enabled": true,
        "auto_save_interval_secs": 30,
        "recovery_enabled": true,
        "auto_recovery_save_interval_secs": 2,
        "highlight_context_bytes": 10000,
        "mouse_hover_enabled": true,
        "mouse_hover_delay_ms": 500,
        "double_click_time_ms": 500,
        "auto_revert_poll_interval_ms": 2000,
        "file_tree_poll_interval_ms": 3000
      },
      "file_explorer": {
        "respect_gitignore": true,
        "show_hidden": false,
        "show_gitignored": false,
        "custom_ignore_patterns": [],
        "width": 0.3
      },
      "clipboard": {
        "use_osc52": true,
        "use_system_clipboard": true
      },
      "terminal": {
        "jump_to_end_on_output": true
      },
      "keybindings": [],
      "active_keybinding_map": "default"
    }
    ```
  </Accordion>
</AccordionGroup>

## Next Steps

<CardGroup cols={2}>
  <Card title="Settings Reference" icon="sliders" href="/configuration/settings">
    Complete list of all editor settings
  </Card>

  <Card title="Keyboard Configuration" icon="keyboard" href="/configuration/keyboard">
    Customize keybindings and keymaps
  </Card>

  <Card title="Theme System" icon="palette" href="/configuration/themes">
    Built-in themes and color customization
  </Card>
</CardGroup>
