# Settings

You can change how *Lx* behaves by editing a settings file.

For most personal changes, use **User Settings**. *Lx* gives this file the final say.

## Settings files

*Lx* reads the files in this order:

1. **Alpha defaults:**

	`user/settings/alpha.lua`
	contains the starting choices supplied with an *Lx* Alpha build. Updates may replace it, so you normally leave this file alone.

2. **Global settings:**

	`user/settings/global.lua`
	contains your settings for everyone using this *Lx* installation. It takes priority over the supplied Alpha defaults.

3. **Computer settings:**

	`user/settings/@<computer>.lua`
	applies to everyone using this copy of *Lx* on that computer. It suits choices tied to its screen, speed, or local folders.

4. **User settings:**

	`user/settings/<user>@<computer>.lua`
	applies only to you on that computer. It is usually the best place for your preferences and shortcuts.

*Lx* creates the real filename from your user and computer names. The filename is always lowercase.

Each later file can replace a value from an earlier file.

For example, the global file may set the frame rate to 60. Your user file can set it to 144. You get 144 because your file is read last.

## Edit a settings file

Open the command palette and run one of these commands:

- `core:edit-user-settings` opens your settings on this computer
- `core:edit-computer-settings` opens settings shared by everyone on this computer
- `core:edit-global-settings` opens settings shared by everyone using this *Lx* installation

Any of these files may be absent. *Lx* simply skips that layer. The global, user, and computer settings commands open a new blank file with the right name when needed.

## Make a simple change

Here is a complete user settings file that changes the indentation size:

```lua
local config = require("core.config")

config.indent_type = "spaces"
config.indent_size = 4
```

The first line gives the file access to *Lx* settings. The remaining lines make Tab insert spaces and set one indentation step to four columns.

See [Indentation](indentation.md) for per-document detection, status controls, conversion commands, and the complete indentation settings.

You can copy a setting from `alpha.lua` into one of your own settings files, then change only the value you care about.

## Save and apply changes

Save the file normally. *Lx* reloads all three settings files in order.

You do not need to restart *Lx*.

If a line is incomplete or misspelled, *Lx* reports the problem. Correct the line and save again.

## Developer details

Friendly developer reports can explain what a feature tried and why it reached its result. Turn them on in your settings:

```lua
config.dev.show_details = true
```

You can also run `dev:toggle-details` to switch them on or off for the current session. Run `log:open` to read the reports. Startup reports show the complete command line, startup controls, results, and time spent in every major stage. Document reports show the request, decoding, file contents, document state, and every loading time. File reference reports show every folder checked and the final result. These reports use clear headings without source-code locations.

## Advanced: choose the files yourself

The file `user/init.lua` controls which settings files *Lx* reads and their order.

Most people never need to change it. Leave it alone unless you want a different settings arrangement.
