1
0
Fork 0
dotfiles/.emacs.d/include/cppconfig.el
Lucas Sta Maria 17b05d5d26
fix(emacs): use keymap-local-set instead of local-set-key
Signed-off-by: Lucas Sta Maria <lucas@priime.dev>
2024-01-23 16:36:38 -05:00

27 lines
750 B
EmacsLisp

;;; cppconfig.el --- Configuration for C/C++
;;; Commentary:
;; Custom configuration for C/C++.
;;; Code:
(defun custom-compile-c++ ()
"Run the `just' command -- the command I use to compile my environment."
(interactive)
(save-buffer)
(compile (concat "just build " (buffer-name))))
(defun custom-run-c++ ()
"Run the produced `bin' binary."
(interactive)
(shell-command "./bin"))
(defun configure-c++ ()
"Configure my custom C++ enviroment."
(keymap-local-set "C-c C-c" #'custom-compile-c++)
(keymap-local-set "C-c C-r" #'custom-run-c++)
(keymap-local-set "C-c C-." #'company-complete))
(add-hook 'c-mode-hook #'configure-c++)
(add-hook 'c++-mode-hook #'configure-c++)
(provide 'cppconfig)
;;; cppconfig.el ends here