diff options
| author | Craig Jennings <c@cjennings.net> | 2025-10-20 16:17:30 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2025-10-20 16:17:30 -0500 |
| commit | df4469f231e86877b7d055bf989220a5fbc0a763 (patch) | |
| tree | ea3ef00d10a7a7c1366213d493ea4e2546b9d783 /modules/prog-c.el | |
| parent | ce8477e80e0a837ac462b97c1a4b5d834838d6d3 (diff) | |
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.el | 19 |
1 files changed, 14 insertions, 5 deletions
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 ("<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) |
