> For AI agents: the complete documentation index is available at /docs/llms.txt, the full documentation bundle is available at /docs/llms-full.txt.

# Configuration

The configuration file can either be named `.neocmake.toml` or `.neocmakelint.toml` and is resolved in the current project directory. If neither is found, a user configuration file named `config.toml` or `lint.toml` can be used. The location of this user configuration file differs across different operating systems:

- Linux: `$XDG_CONFIG_HOME/neocmakelsp/config.toml or $HOME/.config/neocmakelsp/config.toml`
- macOS: `$HOME/Library/Application Support/neocmakelsp/config.toml`
- Windows: `{FOLDERID_RoamingAppData}/neocmakelsp/config.toml`

::: warning

This document describes the configuration of the latest git version of `neocmakelsp`.

:::

::: info

Only a single configuration file will be used. The first file found in the
order described above will be used.

:::

## Top-Level Configuration

::: warning

The builtin formatter is currently not configurable. The configuration settings
listed below only influence the linting behavior.

:::

### `command_case`

- **Type:** String
- **Description:** Enable linting of consistency in command casing.
- **Valid values**:
  - `"upper_case"`: Commands must be uppercase.
  - `"lower_case"`: Commands must be lowercase.
- **Default:** Unset
- **Example:**

```toml title=".neocmake.toml"
# Check that commands are lowercase.
command_upcase = "upcase"
```

### `enable_external_cmake_lint`

- **Type:** Boolean
- **Description:** Enable linting with [`cmake-lint`](https://github.com/cmake-lint/cmake-lint).
- **Default:** `false`
- **Example:**

```toml title=".neocmake.toml"
# Run `cmake-lint` as part of the linting process.
enable_external_cmake_lint = true
```

### `line_max_words`

- **Type:** Integer
- **Description:** Maximum number of words allowed on a single line.
- **Default:** `80`
- **Example:**

```toml title=".neocmake.toml"
# Set maximum line length to 100 characters.
line_max_words = 100
```

## Format Configuration

### `program`

- **Type:** String
- **Description:** External program to use for auto-formatting.
- **Default:** Unset
- **Example:**

```toml title=".neocmake.toml"
[format]
# Format with an external formatter.
program = "gersemi"
args = ["-"]
```

### `args`

- **Type:** Array of strings
- **Description:** Extra arguments to pass to the formatting program.
- **Default:** Unset
- **Example:**

```toml title=".neocmake.toml"
[format]
program = "gersemi"
# Use two space indentation.
args = ["--indent", "2", "-"]
```
