summaryrefslogtreecommitdiff
path: root/lisp/programming/c.el
diff options
context:
space:
mode:
authorJakob L. Kreuze2020-06-01 16:53:50 -0400
committerJakob L. Kreuze2020-06-01 16:53:50 -0400
commit6c7f0b8ae2de30a808901b16b0d462fe833ea1b4 (patch)
tree2cc0a3e9022fc43c39e5b91f4e7832b5387636e9 /lisp/programming/c.el
parent4d4f759881e310818055c31f286158da9db60d1c (diff)
Break config into files.
Diffstat (limited to 'lisp/programming/c.el')
-rw-r--r--lisp/programming/c.el42
1 files changed, 42 insertions, 0 deletions
diff --git a/lisp/programming/c.el b/lisp/programming/c.el
new file mode 100644
index 0000000..6ba19e2
--- /dev/null
+++ b/lisp/programming/c.el
@@ -0,0 +1,42 @@
+;;; c.el -*- lexical-binding: t; -*-
+;;;
+;;; Author: Jakob L. Kreuze <zerodaysfordays@sdf.org>
+;;; URL: https://git.sr.ht/~jakob/.emacs.d/
+;;;
+;;; Configuration of a development environment for the C programming language.
+;;;
+
+(use-package cc-mode
+ :straight nil
+
+ ;; Generally, I adhere to the Linux kernel coding style [1].
+ ;;
+ ;; [1]: https://www.kernel.org/doc/html/v4.10/process/coding-style.html
+ :hook
+ (c-mode . (lambda ()
+ (setq indent-tabs-mode t)
+ (c-set-style "linux")))
+
+ ;; Enable company, Flycheck, and ElDoc, integration for all of which is
+ ;; provided by `irony-mode'.
+ :hook
+ (c-mode . company-mode)
+ (c-mode . flycheck-mode)
+ (c-mode . eldoc-mode))
+
+(use-package irony
+ :hook
+ (c-mode . irony-mode)
+ (irony-mode . irony-cdb-autosetup-compile-options))
+
+(use-package company-irony
+ :config
+ (add-to-list 'company-backend 'company-irony))
+
+(use-package flycheck-irony
+ :hook
+ (flycheck-mode . flycheck-irony-setup))
+
+(use-package irony-eldoc
+ :hook
+ (irony-mode . irony-eldoc))

© 2015 - 2026 Jakob L. Kreuze