feat: add cppconfig.el
Signed-off-by: Lucas Sta Maria <lucas@priime.dev>
This commit is contained in:
parent
34e01fde7d
commit
08b120f0b7
3 changed files with 31 additions and 1 deletions
27
.emacs.d/include/cppconfig.el
Normal file
27
.emacs.d/include/cppconfig.el
Normal file
|
@ -0,0 +1,27 @@
|
|||
;;; 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."
|
||||
(local-set-key (kbd "C-c C-c") #'custom-compile-c++)
|
||||
(local-set-key (kbd "C-c C-r") #'custom-run-c++)
|
||||
(local-set-key (kbd "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
|
|
@ -59,6 +59,7 @@
|
|||
(straight-use-package 'scribble-mode)
|
||||
(straight-use-package 'go-mode)
|
||||
(straight-use-package 'auctex)
|
||||
(straight-use-package 'yaml-mode)
|
||||
|
||||
|
||||
;; ====== Custom =============================
|
||||
|
@ -71,6 +72,7 @@
|
|||
(load-library "mu4econfig")
|
||||
(load-library "racket")
|
||||
(load-library "latexconfig")
|
||||
(load-library "cppconfig")
|
||||
|
||||
;; ====== Hooks ==============================
|
||||
(add-hook 'after-init-hook 'global-company-mode)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue