helix-mods/book/src/languages.md
ammkrn acced82be6
feat(book/src/languages.md) (#979)
* feat(book/src/languages.md)

Add a section in the book about language-specific settings and the languages.toml file.

* Update book/src/languages.md

Co-authored-by: Gokul Soumya <gokulps15@gmail.com>

* feat(book/src/guides/adding_languages.md)

Add book section on adding a new language to the compile-time/root languages.toml file.

* Update book/src/guides/adding_languages.md

Co-authored-by: Blaž Hrastnik <blaz@mxxn.io>

* Update book/src/guides/adding_languages.md

Co-authored-by: Blaž Hrastnik <blaz@mxxn.io>

* refactor(revise book/src/languages.md)

Change the book page on language settings to match suggestions by archseer and mention both toml files.

Co-authored-by: Gokul Soumya <gokulps15@gmail.com>
Co-authored-by: Blaž Hrastnik <blaz@mxxn.io>
2021-11-07 10:31:12 +09:00

1.4 KiB

Languages

Language-specific settings and settings for particular language servers can be configured in a languages.toml file placed in your configuration directory. Helix actually uses two languages.toml files, the first one is in the main helix repository; it contains the default settings for each language and is included in the helix binary at compile time. Users who want to see the available settings and options can either reference the helix repo's languages.toml file, or consult the table in the adding languages section.

Changes made to the languages.toml file in a user's configuration directory are merged with helix's defaults on start-up, such that a user's settings will take precedence over defaults in the event of a collision. For example, the default languages.toml sets rust's auto-format to true. If a user wants to disable auto-format, they can change the languages.toml in their configuration directory to make the rust entry read like the example below; the new key/value pair auto-format = false will override the default when the two sets of settings are merged on start-up:

# in <config_dir>/helix/languages.toml

[[language]]
name = "rust"
auto-format = false