| author | Luke Hoersten <luke@hoersten.org> | 
| Thu, 02 Oct 2025 09:50:40 -0500 | |
| changeset 105 | e45e60614994 | 
| parent 71 | b5976ed7311a | 
| permissions | -rw-r--r-- | 
| 
40
 
886afd628fa2
Split off programming language-specific custimizations to separate init files.
 
Luke Hoersten <Luke@Hoersten.org> 
parents:  
diff
changeset
 | 
1  | 
;; ~/.emacs.d/c-hook.el | 
| 
 
886afd628fa2
Split off programming language-specific custimizations to separate init files.
 
Luke Hoersten <Luke@Hoersten.org> 
parents:  
diff
changeset
 | 
2  | 
;; Luke Hoersten <[email protected]> | 
| 
 
886afd628fa2
Split off programming language-specific custimizations to separate init files.
 
Luke Hoersten <Luke@Hoersten.org> 
parents:  
diff
changeset
 | 
3  | 
|
| 
 
886afd628fa2
Split off programming language-specific custimizations to separate init files.
 
Luke Hoersten <Luke@Hoersten.org> 
parents:  
diff
changeset
 | 
4  | 
(require 'hoersten-c-style)  | 
| 
 
886afd628fa2
Split off programming language-specific custimizations to separate init files.
 
Luke Hoersten <Luke@Hoersten.org> 
parents:  
diff
changeset
 | 
5  | 
|
| 
 
886afd628fa2
Split off programming language-specific custimizations to separate init files.
 
Luke Hoersten <Luke@Hoersten.org> 
parents:  
diff
changeset
 | 
6  | 
(add-hook  | 
| 
 
886afd628fa2
Split off programming language-specific custimizations to separate init files.
 
Luke Hoersten <Luke@Hoersten.org> 
parents:  
diff
changeset
 | 
7  | 
'c-mode-common-hook  | 
| 
 
886afd628fa2
Split off programming language-specific custimizations to separate init files.
 
Luke Hoersten <Luke@Hoersten.org> 
parents:  
diff
changeset
 | 
8  | 
(lambda ()  | 
| 
 
886afd628fa2
Split off programming language-specific custimizations to separate init files.
 
Luke Hoersten <Luke@Hoersten.org> 
parents:  
diff
changeset
 | 
9  | 
;; indentation  | 
| 
 
886afd628fa2
Split off programming language-specific custimizations to separate init files.
 
Luke Hoersten <Luke@Hoersten.org> 
parents:  
diff
changeset
 | 
10  | 
(setq  | 
| 
 
886afd628fa2
Split off programming language-specific custimizations to separate init files.
 
Luke Hoersten <Luke@Hoersten.org> 
parents:  
diff
changeset
 | 
11  | 
tab-width 3  | 
| 
 
886afd628fa2
Split off programming language-specific custimizations to separate init files.
 
Luke Hoersten <Luke@Hoersten.org> 
parents:  
diff
changeset
 | 
12  | 
c-basic-offset 3  | 
| 
 
886afd628fa2
Split off programming language-specific custimizations to separate init files.
 
Luke Hoersten <Luke@Hoersten.org> 
parents:  
diff
changeset
 | 
13  | 
indent-tabs-mode t  | 
| 
 
886afd628fa2
Split off programming language-specific custimizations to separate init files.
 
Luke Hoersten <Luke@Hoersten.org> 
parents:  
diff
changeset
 | 
14  | 
standard-indent 3  | 
| 
 
886afd628fa2
Split off programming language-specific custimizations to separate init files.
 
Luke Hoersten <Luke@Hoersten.org> 
parents:  
diff
changeset
 | 
15  | 
whitespace-line-column 120)  | 
| 
 
886afd628fa2
Split off programming language-specific custimizations to separate init files.
 
Luke Hoersten <Luke@Hoersten.org> 
parents:  
diff
changeset
 | 
16  | 
|
| 
 
886afd628fa2
Split off programming language-specific custimizations to separate init files.
 
Luke Hoersten <Luke@Hoersten.org> 
parents:  
diff
changeset
 | 
17  | 
(setq  | 
| 
 
886afd628fa2
Split off programming language-specific custimizations to separate init files.
 
Luke Hoersten <Luke@Hoersten.org> 
parents:  
diff
changeset
 | 
18  | 
compile-command "scons "  | 
| 
 
886afd628fa2
Split off programming language-specific custimizations to separate init files.
 
Luke Hoersten <Luke@Hoersten.org> 
parents:  
diff
changeset
 | 
19  | 
c-hungry-delete-key t)  | 
| 
 
886afd628fa2
Split off programming language-specific custimizations to separate init files.
 
Luke Hoersten <Luke@Hoersten.org> 
parents:  
diff
changeset
 | 
20  | 
|
| 
 
886afd628fa2
Split off programming language-specific custimizations to separate init files.
 
Luke Hoersten <Luke@Hoersten.org> 
parents:  
diff
changeset
 | 
21  | 
(c-toggle-auto-newline t) ; auto newline  | 
| 
 
886afd628fa2
Split off programming language-specific custimizations to separate init files.
 
Luke Hoersten <Luke@Hoersten.org> 
parents:  
diff
changeset
 | 
22  | 
(c-subword-mode t)  | 
| 
 
886afd628fa2
Split off programming language-specific custimizations to separate init files.
 
Luke Hoersten <Luke@Hoersten.org> 
parents:  
diff
changeset
 | 
23  | 
|
| 
 
886afd628fa2
Split off programming language-specific custimizations to separate init files.
 
Luke Hoersten <Luke@Hoersten.org> 
parents:  
diff
changeset
 | 
24  | 
;; custom keys  | 
| 
 
886afd628fa2
Split off programming language-specific custimizations to separate init files.
 
Luke Hoersten <Luke@Hoersten.org> 
parents:  
diff
changeset
 | 
25  | 
(local-set-key (kbd "C-c f") 'ff-find-other-file) ; toggle header/source file  | 
| 
 
886afd628fa2
Split off programming language-specific custimizations to separate init files.
 
Luke Hoersten <Luke@Hoersten.org> 
parents:  
diff
changeset
 | 
26  | 
|
| 
 
886afd628fa2
Split off programming language-specific custimizations to separate init files.
 
Luke Hoersten <Luke@Hoersten.org> 
parents:  
diff
changeset
 | 
27  | 
;; ;; code folding  | 
| 
 
886afd628fa2
Split off programming language-specific custimizations to separate init files.
 
Luke Hoersten <Luke@Hoersten.org> 
parents:  
diff
changeset
 | 
28  | 
;; (local-set-key (kbd "C-c v") 'hs-toggle-hiding)  | 
| 
 
886afd628fa2
Split off programming language-specific custimizations to separate init files.
 
Luke Hoersten <Luke@Hoersten.org> 
parents:  
diff
changeset
 | 
29  | 
;; (local-set-key (kbd "<f1>") 'hs-hide-all)  | 
| 
 
886afd628fa2
Split off programming language-specific custimizations to separate init files.
 
Luke Hoersten <Luke@Hoersten.org> 
parents:  
diff
changeset
 | 
30  | 
;; (local-set-key (kbd "<f2>") 'hs-show-all)  | 
| 
 
886afd628fa2
Split off programming language-specific custimizations to separate init files.
 
Luke Hoersten <Luke@Hoersten.org> 
parents:  
diff
changeset
 | 
31  | 
;; (hs-minor-mode t) ; enable hide-show mode  | 
| 
 
886afd628fa2
Split off programming language-specific custimizations to separate init files.
 
Luke Hoersten <Luke@Hoersten.org> 
parents:  
diff
changeset
 | 
32  | 
|
| 
 
886afd628fa2
Split off programming language-specific custimizations to separate init files.
 
Luke Hoersten <Luke@Hoersten.org> 
parents:  
diff
changeset
 | 
33  | 
;; gdb settings  | 
| 
 
886afd628fa2
Split off programming language-specific custimizations to separate init files.
 
Luke Hoersten <Luke@Hoersten.org> 
parents:  
diff
changeset
 | 
34  | 
(setq  | 
| 
 
886afd628fa2
Split off programming language-specific custimizations to separate init files.
 
Luke Hoersten <Luke@Hoersten.org> 
parents:  
diff
changeset
 | 
35  | 
gdb-many-windows t ; gdb many windows  | 
| 
 
886afd628fa2
Split off programming language-specific custimizations to separate init files.
 
Luke Hoersten <Luke@Hoersten.org> 
parents:  
diff
changeset
 | 
36  | 
gdb-use-separate-io-buffer t ; gdb stdio output  | 
| 
 
886afd628fa2
Split off programming language-specific custimizations to separate init files.
 
Luke Hoersten <Luke@Hoersten.org> 
parents:  
diff
changeset
 | 
37  | 
gud-tooltip-mode t) ; mouse hover variables  | 
| 
 
886afd628fa2
Split off programming language-specific custimizations to separate init files.
 
Luke Hoersten <Luke@Hoersten.org> 
parents:  
diff
changeset
 | 
38  | 
(local-set-key (kbd "C-c g") 'gdb) ; gdb  | 
| 
 
886afd628fa2
Split off programming language-specific custimizations to separate init files.
 
Luke Hoersten <Luke@Hoersten.org> 
parents:  
diff
changeset
 | 
39  | 
|
| 
 
886afd628fa2
Split off programming language-specific custimizations to separate init files.
 
Luke Hoersten <Luke@Hoersten.org> 
parents:  
diff
changeset
 | 
40  | 
;; auto-close bracing  | 
| 
 
886afd628fa2
Split off programming language-specific custimizations to separate init files.
 
Luke Hoersten <Luke@Hoersten.org> 
parents:  
diff
changeset
 | 
41  | 
(setq parens-require-spaces nil)  | 
| 
 
886afd628fa2
Split off programming language-specific custimizations to separate init files.
 
Luke Hoersten <Luke@Hoersten.org> 
parents:  
diff
changeset
 | 
42  | 
(dolist (key '("(" "[")) (define-key (current-local-map) key 'insert-pair))  | 
| 
 
886afd628fa2
Split off programming language-specific custimizations to separate init files.
 
Luke Hoersten <Luke@Hoersten.org> 
parents:  
diff
changeset
 | 
43  | 
))  | 
| 
 
886afd628fa2
Split off programming language-specific custimizations to separate init files.
 
Luke Hoersten <Luke@Hoersten.org> 
parents:  
diff
changeset
 | 
44  | 
|
| 
 
886afd628fa2
Split off programming language-specific custimizations to separate init files.
 
Luke Hoersten <Luke@Hoersten.org> 
parents:  
diff
changeset
 | 
45  | 
(add-to-list 'auto-mode-alist '("\\.ipp$" . c++-mode))  | 
| 
 
886afd628fa2
Split off programming language-specific custimizations to separate init files.
 
Luke Hoersten <Luke@Hoersten.org> 
parents:  
diff
changeset
 | 
46  | 
(add-to-list 'auto-mode-alist '("\\.inl$" . c++-mode))  | 
| 
 
886afd628fa2
Split off programming language-specific custimizations to separate init files.
 
Luke Hoersten <Luke@Hoersten.org> 
parents:  
diff
changeset
 | 
47  | 
|
| 
44
 
6e66ab8d9185
Split out some init files.
 
Luke Hoersten <Luke@Hoersten.org> 
parents: 
41 
diff
changeset
 | 
48  | 
(message "Loading c-init...done")  | 
| 
 
6e66ab8d9185
Split out some init files.
 
Luke Hoersten <Luke@Hoersten.org> 
parents: 
41 
diff
changeset
 | 
49  | 
(provide 'c-init)  |