From df4469f231e86877b7d055bf989220a5fbc0a763 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Mon, 20 Oct 2025 16:17:30 -0500 Subject: 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. --- modules/prog-c.el | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'modules/prog-c.el') diff --git a/modules/prog-c.el b/modules/prog-c.el index 12c28e54..d9191bf4 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 ("" . 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-") #'compile) - (local-set-key (kbd "S-") #'gdb) - (local-set-key (kbd "") #'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-") #'recompile) + + ;; S-f5: Static analysis placeholder (could add clang-tidy, cppcheck, etc.) + (local-set-key (kbd "S-") #'cj/disabled) + + ;; S-f6: Debug with GDB + (local-set-key (kbd "S-") #'gdb)) (add-hook 'c-mode-hook 'cj/c-mode-keybindings) (add-hook 'c-ts-mode-hook 'cj/c-mode-keybindings) -- cgit v1.2.3