Files
nixfiles/xdg/emacs/modes/c-mode.el

28 lines
874 B
EmacsLisp
Raw Normal View History

2025-09-26 17:51:52 -04:00
;; New Keybindings
(define-key c-mode-base-map (kbd "<f11>") 'compile)
(define-key c-mode-base-map "\C-c\C-c" 'compile)
(define-key c-mode-base-map (kbd "RET") 'newline-and-indent)
(define-key c-mode-base-map (kbd "C-c SPC") 'hs-toggle-hiding)
;; Syntax hilighting
(setq c-default-style "stroustrup")
;; Bury the compile buffer when finished compiling. Function in lisp/functions.el
(add-hook 'compilation-finish-functions 'bury-compile-buffer-if-successful)
;; Define Tab width
(setq truncate-lines 1)
(setq tab-width 4)
(setq indent-tabs-mode nil)
;; Make backspace and C-d delete whitespace
(c-toggle-hungry-state t)
;; When using a new enough version of emacs, use many gdb windows.
(when (or (> emacs-major-version 23)
(and (= emacs-major-version 23)
(>= emacs-minor-version 2)))
;; Use the GDB visual debugging moden
(setq gdb-many-windows t)
)