doomemacs/modules/tools/editorconfig
Henrik Lissner 1a05e2fa64
bump: :tools
NicolasPetton/pass@c721604b3b -> NicolasPetton/pass@ed7031c5c3
Silex/docker.el@6997c86a24 -> Silex/docker.el@d5255a65b7
alphapapa/magit-todos@cadf29d1cc -> alphapapa/magit-todos@debb77b358
andras-simonyi/citeproc-el@290320fc57 -> andras-simonyi/citeproc-el@c61c98b9d2
doomelpa/code-review@26f426e992 -> doomelpa/code-review@c34ff1ee64
editorconfig/editorconfig-emacs@2fed9599bc -> editorconfig/editorconfig-emacs@4b81a59928
emacs-citar/citar-org-roam@761eed6678 -> emacs-citar/citar-org-roam@7d67dccf80
emacs-citar/citar@2c0547db57 -> emacs-citar/citar@885b86f673
emacs-lsp/lsp-mode@02c5ba59ce -> emacs-lsp/lsp-mode@fb88cc6b8b
emacs-straight/eglot@f73594f589 -> emacs-straight/eglot@cd4e45b700
emacs-straight/rainbow-mode@24437ec2c6 -> emacs-straight/rainbow-mode@70ed10d410
emacs-tree-sitter/tree-sitter-langs@5eb24557f5 -> emacs-tree-sitter/tree-sitter-langs@20fbbb8573
emacsorphanage/quickrun@6f96318930 -> emacsorphanage/quickrun@248149b026
hcl-emacs/terraform-mode@39d2fd5bfc -> hcl-emacs/terraform-mode@e8b57df8c2
jacktasia/dumb-jump@d9503c157a -> jacktasia/dumb-jump@ede6a04187
magit/forge@ba35ffc9ba -> magit/forge@b16b6ec4f7
magit/magit@4881835572 -> magit/magit@54d37dc14c
meain/evil-textobj-tree-sitter@9a9edd42a2 -> meain/evil-textobj-tree-sitter@220ceae065
purcell/envrc@33d01388ce -> purcell/envrc@1385e72a73
rejeep/prodigy.el@a3be00d3b9 -> rejeep/prodigy.el@cc68fa9d60
tmalsburg/helm-bibtex@ef07adfeda -> tmalsburg/helm-bibtex@bf184cc311
xuchunyang/osx-dictionary.el@0715e5a3ac -> xuchunyang/osx-dictionary.el@1f5a74f3e5
yoshiki/yaml-mode@3fcb36d603 -> yoshiki/yaml-mode@5b58248ab2
zx2c4/password-store@28cec11f1d -> zx2c4/password-store@b5e965a838
2024-02-04 19:07:25 -05:00
..
autoload.el 💥 Remove :feature category 2019-04-24 18:16:04 -04:00
config.el refactor: rename orig-fn arg in advice to fn 2021-08-04 01:53:12 -04:00
doctor.el tools/editorconfig: add binary check to doctor.el 2018-09-28 23:52:22 -04:00
packages.el bump: :tools 2024-02-04 19:07:25 -05:00
README.org docs(*): replace all-the-icons with nerd-icons 2023-09-16 20:19:11 +02:00

:tools editorconfig

Description   unfold

This module integrates EditorConfig into Emacs, allowing users to dictate code style on a per-project basis with an .editorconfig file (formal specification).

Module flags

This module has no flags.

Hacks

  • Added logic to guess an extension-less file's type from its shebang line. For example, editorconfig rules for *.py files will apply to bin/myscript assuming its first line is #!/usr/bin/env python. See +editorconfig-mode-alist for adding support for more languages.
  • Special integration for dtrt-indent: If the local editorconfig file specifies indent_style or indent_size, the doom-package:dtrt-indent (which tries to guess your indent settings by analyzing your text file) will bow out.
  • Special integration for ws-butler: this module will use doom-package:ws-butler to enforce trim_trailing_whitespace.

TODO Changelog

This module does not have a changelog yet.

Installation

Enable this module in your doom! block.

This module has one optional dependency: the editorconfig native binary. Without it, a built-in elisp implementation will be used, but it has fewer features and can be a bit slower.

The editorconfig binary has many implementations you can choose from, typically available through your OS package manager (or build it yourself).

Usage

You will need to write an .editorconfig file in your project (this is usually in the root of your project) you can find out about all the properties here.

TODO Configuration

󱌣 This module's configuration documentation is incomplete. Complete it?

Adding support for more major modes

Out the box, the editorconfig plugin supports many Emacs major modes, but it's possible you'll find one it doesn't support. Adding support is easy so long as you know that mode's indentation variables. For example, coffee-mode has a coffee-tab-width variable that controls indentation width in CoffeeScript files. Editorconfig already supports this language, but let's pretend it doesn't:

The editorconfig-indentation-alist variable contains a list of major modes and their indentation variables. To add coffee-mode to it:

;; in $DOOMDIR/config.el
(after! editorconfig
  (add-to-list 'editorconfig-indentation-alist '(coffee-mode coffee-tab-width)))

But what if you don't know the correct indentation variable(s). Use SPC h v (C-h v for non-evil users) to peruse all the available variables in your current session of Emacs. Look for variables that have the words indent, offset or tab-width in them. They will be prefixed with the plugin they belong to (e.g. rustic-indent-offset).

Troubleshooting

There are no known problems with this module. Report one?

Frequently asked questions

This module has no FAQs yet. Ask one?

TODO Appendix

󱌣 This module has no appendix yet. Write one?