Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

editorconfig

Stow package for ~/.editorconfig. Vim picks it up via editorconfig/editorconfig-vim (in vim/.vimrc); most editors / IDEs support it natively.

Table of contents

Layout

FileStows to
editorconfig/.editorconfig~/.editorconfig

Defaults

[*]
charset                  = utf-8
end_of_line              = lf
indent_style             = space
indent_size              = 2
insert_final_newline     = true
trim_trailing_whitespace = true
max_line_length          = 100

Per-language overrides:

PatternIndentNotes
*.gotabGo convention
Makefile, *.mktabMake requires tabs
*.py4 spacesPEP 8
*.{rs,c,cpp,h,hpp,java,kt,scala}4 spaces
*.mdtrim_trailing_whitespace = false, no max_line_length

Per-project overrides

This file has root = true so editorconfig stops walking up the filesystem when it finds it. Any project’s own .editorconfig overrides this one — drop a more specific file in your project root when you need different rules.

Fresh-machine setup

stow editorconfig

Vim’s editorconfig-vim plugin (in vim/) reads this automatically. For other editors: VS Code, JetBrains, Sublime, Neovim, and most modern editors support .editorconfig natively or via a free plugin.