aboutsummaryrefslogtreecommitdiff
path: root/Emacs/.config/emacs/config.org
diff options
context:
space:
mode:
authorAryadev Chavali <aryadev@aryadevchavali.com>2021-03-09 18:14:12 +0000
committerAryadev Chavali <aryadev@aryadevchavali.com>2021-03-09 18:14:12 +0000
commit56520519de5d1554698aeaf8e4b11ca57ce64f51 (patch)
treed87beaaf4ff0685d0d7ea05e017d6441893ebb8f /Emacs/.config/emacs/config.org
parentec742cbbcd830de66e574258d3d1be30f5d0fb7a (diff)
downloaddotfiles-56520519de5d1554698aeaf8e4b11ca57ce64f51.tar.gz
dotfiles-56520519de5d1554698aeaf8e4b11ca57ce64f51.tar.bz2
dotfiles-56520519de5d1554698aeaf8e4b11ca57ce64f51.zip
(Emacs)+c/c++ auto inserts
Diffstat (limited to 'Emacs/.config/emacs/config.org')
-rw-r--r--Emacs/.config/emacs/config.org40
1 files changed, 40 insertions, 0 deletions
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)