foxygit / doom Log in
commit da60fc0b0a52e7d9b3aa16e37d81634860d441cf
Author:     Simon Howard <fraggle@soulsphere.org>
AuthorDate: Sat Feb 16 20:32:19 2019 -0500
Commit:     Simon Howard <fraggle@soulsphere.org>
CommitDate: Sat Feb 16 20:32:19 2019 -0500

    HACKING: Add section with config for Vim, Emacs.

    It makes sense to have some instructions for these editors since they
    are popular.
---
 HACKING.md | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/HACKING.md b/HACKING.md
index 631d4464..c55aafda 100644
--- a/HACKING.md
+++ b/HACKING.md
@@ -125,6 +125,27 @@ void FunctionName(int argument, int arg2, int arg3, int arg4, int arg5,
 }
 ```

+## Editor-specific default settings
+
+If you use vim, you can put this into your `.vimrc` (or install the
+`localvimrc` script):
+```
+set expandtab
+set tabstop=8
+set softtabstop=4
+set shiftwidth=4
+```
+Or, if you use Emacs, put this in your `.emacs`:
+``lisp
+(add-hook 'c-mode-hook (lambda ()
+  (when (and buffer-file-name
+             (string-match "chocolate-doom" buffer-file-name))
+    (c-set-style "bsd")
+    (setq indent-tabs-mode nil)
+    (setq tab-width 8)
+    (setq c-basic-offset 4))))
+```
+
 ## Security

 The C standard library has a number of unsafe functions that should be