14. Buffer-local configuration: EditorConfig and file-local variables

These configurations affect only one buffer and take precedence over global options.

EditorConfig

When a file opens, coxn searches upward for .editorconfig, stopping at root = true; sections closer to the file override higher sections. Supported standard properties:

PropertyEffect
indent_stylespace / tab
indent_sizeIndentation width (tab uses tab_width)
tab_widthTab display width
end_of_linelf / crlf
trim_trailing_whitespaceRemove trailing whitespace on save
insert_final_newlineEnsure a final newline on save
max_line_lengthMaximum line width

file-local variables

Only whitelisted variables are recognized; code in the file is never evaluated. Use the first line:

c
/* -*- mode: c; indent-offset: 2; tab-width: 4 -*- */
代码

or the end of the file:
text
Local Variables:
fill-column: 80
End:
代码

Whitelist: `mode` (only an already-registered major mode), `comment-start`,
`comment-end`, `fill-column`, `indent-offset`, `tab-width`, `indent-style`,
`insert-spaces?`, `eol`, `trim-trailing?`, `final-newline?`, `truncate-lines`, and
`eval-minibuffer?`.

Raw Markdown: coxn manual (Markdown) · Installers: coxn product page