branch: scratch/editorconfig-cc
commit c09aa6e58a3dd06591dc80af266d2c5804bb9c90
Author: 10sr <8slashes+...@gmail.com>
Commit: Stefan Monnier <monn...@iro.umontreal.ca>

    Add Customize section to README
---
 README.md | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

diff --git a/README.md b/README.md
index ee4e3aef54..eff94ba376 100644
--- a/README.md
+++ b/README.md
@@ -16,6 +16,39 @@ Alternatively, you can find the package available on
 * `charset`
 * `max_line_length`
 
+## Customize
+
+### `editorconfig-custom-hooks`
+
+A list of custom hooks after loading common EditorConfig settings, where you 
can
+set some custom variables or overwrite existing properties.
+
+For example, `web-mode` has several variables for indentation offset size and
+EditorConfig sets them at once by `indent_size`. You may want to stop indenting
+only blocks of `web-mode`: it can be achieved by adding following to your 
init.el:
+
+```emacs-lisp
+(add-hook 'editorconfig-custom-hooks
+          (lambda (hash) (setq web-mode-block-padding 0)))
+```
+
+You can also define your own custom properties and enable them here.
+
+### `editorconfig-indentation-alist`
+
+Alist of indentaion setting mothods by modes.
+
+For the easiest case to add a new support for a major-mode, you just need to
+add a pair of major-mode symbol and its indentation variables:
+
+```emacs-lisp
+(add-to-list 'editorconfig-indentation-alist
+    ;; Just an example, of course EditorConfig already includes this setting!
+    '(c-mode c-basic-offset))
+```
+
+For a bit more compilicated cases please take a look at the docstring of this 
variable.
+
 ## Testing
 
 Make and [CMake](https://cmake.org) must be installed to run the tests.

Reply via email to