aboutsummaryrefslogtreecommitdiff
path: root/modules/prog-c.el
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2025-10-20 16:17:30 -0500
committerCraig Jennings <c@cjennings.net>2025-10-20 16:17:30 -0500
commit0f591307b683c90bf28ae78c12af57f28c63d646 (patch)
tree0365364c60bb631c98b8d3694e5db7ca42050704 /modules/prog-c.el
parent23568beb383f2afa5238a014350c8b4796cacd83 (diff)
downloaddotemacs-0f591307b683c90bf28ae78c12af57f28c63d646.tar.gz
dotemacs-0f591307b683c90bf28ae78c12af57f28c63d646.zip
feat:programming: Enhance language-specific keybindings and setup
Add language-specific keybindings and configurations for C, Go, Python, and shell scripting panels. Introduce system utility function declarations and improve keybinding consistency across languages. Implement keybindings for debug, format, and static analysis tools tailored to each programming language, enhancing the developer experience and workflow efficiency.
Diffstat (limited to 'modules/prog-c.el')
-rw-r--r--modules/prog-c.el19
1 files changed, 14 insertions, 5 deletions
diff --git a/modules/prog-c.el b/modules/prog-c.el
index 12c28e543..d9191bf40 100644
--- a/modules/prog-c.el
+++ b/modules/prog-c.el
@@ -40,6 +40,9 @@
;; Forward declarations for compile
(declare-function recompile "compile")
+;; Forward declarations for system utilities
+(declare-function cj/disabled "system-defaults")
+
(defvar clangd-path "clangd"
"Path to clangd language server executable.")
@@ -93,7 +96,7 @@
:if (executable-find clang-format-path)
:bind (:map c-mode-base-map
("<f6>" . clang-format-buffer)
- ("C-c f" . clang-format-buffer)))
+ ("C-; f" . clang-format-buffer)))
;; -------------------------------- Compilation --------------------------------
;; Smart compilation with project detection
@@ -132,10 +135,16 @@
;; -------------------------------- Keybindings --------------------------------
(defun cj/c-mode-keybindings ()
- "Set up keybindings for C programming."
- (local-set-key (kbd "S-<f2>") #'compile)
- (local-set-key (kbd "S-<f3>") #'gdb)
- (local-set-key (kbd "<f5>") #'recompile))
+ "Set up keybindings for C programming.
+Overrides default prog-mode keybindings with C-specific commands."
+ ;; S-f4: Recompile (override default - C uses this more than projectile-compile)
+ (local-set-key (kbd "S-<f4>") #'recompile)
+
+ ;; S-f5: Static analysis placeholder (could add clang-tidy, cppcheck, etc.)
+ (local-set-key (kbd "S-<f5>") #'cj/disabled)
+
+ ;; S-f6: Debug with GDB
+ (local-set-key (kbd "S-<f6>") #'gdb))
(add-hook 'c-mode-hook 'cj/c-mode-keybindings)
(add-hook 'c-ts-mode-hook 'cj/c-mode-keybindings)