From 0b2c26b0e1fb7aaafcd2bf656b739d9b7223bc65 Mon Sep 17 00:00:00 2001 From: Matthew Kosarek Date: Mon, 1 Jan 2024 15:55:56 -0500 Subject: oodles of improvements, I don't even know anymore! --- lisp/cpp.el | 13 ++++++++++--- lisp/general.el | 46 +++++++++++++++++++++++++++++++++++++++++++++- lisp/mk.el | 4 ++++ lisp/org-custom.el | 2 +- 4 files changed, 60 insertions(+), 5 deletions(-) (limited to 'lisp') diff --git a/lisp/cpp.el b/lisp/cpp.el index 5bb04a8..eb7660e 100644 --- a/lisp/cpp.el +++ b/lisp/cpp.el @@ -13,15 +13,22 @@ (c-set-offset 'arglist-intro '+) (c-set-offset 'arglist-cont-non-empty '+) (c-set-offset 'argslist-close '+) + (c-set-offset 'statement-cont 0) ) (add-hook 'c-mode-common-hook 'setup-c) -(defun create-cpp-class() - "Create a cpp class." - (interactive "Enter the name of the class: ") +(defun mk/cpp/generate-compile-commands-cmake() + "Regenerates a compile_commands.json database" + (interactive) + (shell-command (format "cd %s && cmake -S . -B build -D CMAKE_EXPORT_COMPILE_COMMANDS=1" (projectile-project-root))) ) +(defun maybe-regenerate-compile-commands() + (if (string= (buffer-file-name) "CMakeLists.txt") + (mk/cpp/generate-compile-commands-cmake))) + +(add-hook 'after-save-hook 'maybe-regenerate-compile-commands) (provide 'cpp) ;;; cpp.el ends here diff --git a/lisp/general.el b/lisp/general.el index 9b3f6c9..4b51b9b 100644 --- a/lisp/general.el +++ b/lisp/general.el @@ -32,6 +32,33 @@ :weight 'normal :width 'normal) +; Taken from: https://emacs.stackexchange.com/questions/55059/ligatures-with-the-jetbrains-mono-font +(defconst jetbrains-ligature-mode--ligatures + '("-->" "//" "/**" "/*" "*/" "