From 56520519de5d1554698aeaf8e4b11ca57ce64f51 Mon Sep 17 00:00:00 2001 From: Aryadev Chavali Date: Tue, 9 Mar 2021 18:14:12 +0000 Subject: (Emacs)+c/c++ auto inserts --- Emacs/.config/emacs/config.org | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) (limited to 'Emacs') diff --git a/Emacs/.config/emacs/config.org b/Emacs/.config/emacs/config.org index c8cfd06..5fc38d2 100644 --- a/Emacs/.config/emacs/config.org +++ b/Emacs/.config/emacs/config.org @@ -1980,7 +1980,47 @@ opposing style. ("||" . "∨") ("for" . "∀") ("return" . "⟼"))) + (with-eval-after-load "autoinsert" + (define-auto-insert + '("\\.c\\'" . "C skeleton") + '("" + "/* " (file-name-nondirectory (buffer-file-name (current-buffer))) "\n" + " * Date: " (format-time-string "%Y-%m-%d") "\n" + " * Author: " user-full-name "\n" + " */\n" + "\n" + "\n" + _)) + + (define-auto-insert + '("\\.cpp\\'" . "C++ skeleton") + '("" + "/* " (file-name-nondirectory (buffer-file-name (current-buffer))) "\n" + " * Date: " (format-time-string "%Y-%m-%d") "\n" + " * Author: " user-full-name "\n" + " */\n" + "\n" + "\n" + _))) :config + (with-eval-after-load "abbrev" + (+autotyping/gen-skeleton-abbrev + c-mode + "sgen" + "Name of item: " + str | "name" "\n" + "{\n" + > _ "\n" + "}\n") + + (+autotyping/gen-skeleton-abbrev + c++-mode + "sgen" + "Name of item: " + > str | "name" "\n" + "{\n" + > _ "\n" + "}\n")) (c-add-style "user" '((c-basic-offset . 2) -- cgit v1.2.3-13-gbd6f