summaryrefslogtreecommitdiff
path: root/settings/setup-auto-insert-mode.el
diff options
context:
space:
mode:
authorbenj <benj@rse8.com>2018-03-14 01:39:34 -0700
committerbenj <benj@rse8.com>2018-03-14 01:39:34 -0700
commitc38ef385a9af288cf2d2ff0f306b6b2176fcf47d (patch)
tree6fb29f8aa6d2d25fb3b6a91d973e0267028bb260 /settings/setup-auto-insert-mode.el
parent4d692027106c9352b9d64206970006c6ac6ab743 (diff)
downloademacs-c38ef385a9af288cf2d2ff0f306b6b2176fcf47d.tar
emacs-c38ef385a9af288cf2d2ff0f306b6b2176fcf47d.tar.gz
emacs-c38ef385a9af288cf2d2ff0f306b6b2176fcf47d.tar.bz2
emacs-c38ef385a9af288cf2d2ff0f306b6b2176fcf47d.tar.lz
emacs-c38ef385a9af288cf2d2ff0f306b6b2176fcf47d.tar.xz
emacs-c38ef385a9af288cf2d2ff0f306b6b2176fcf47d.tar.zst
emacs-c38ef385a9af288cf2d2ff0f306b6b2176fcf47d.zip
added doxygen function comment and auto-insert snippets for c-mode
Diffstat (limited to 'settings/setup-auto-insert-mode.el')
-rw-r--r--settings/setup-auto-insert-mode.el30
1 files changed, 30 insertions, 0 deletions
diff --git a/settings/setup-auto-insert-mode.el b/settings/setup-auto-insert-mode.el
new file mode 100644
index 0000000..81284db
--- /dev/null
+++ b/settings/setup-auto-insert-mode.el
@@ -0,0 +1,30 @@
+(require 'autoinsert)
+
+(defun custom/expand-yasnippet ()
+ "Replace with real stuff"
+ (yas-expand-snippet (buffer-string) (point-min) (point-max)))
+
+(custom-set-variables
+ '(auto-insert-directory (locate-user-emacs-file "auto-insert")))
+
+;; Activate globally
+(auto-insert-mode)
+(setq auto-insert-query nil)
+
+;; Some global auto-insert variables
+(setq user-full-name "Benj Bellon"
+ user-email "benjaminbellon@gmail.com")
+
+;; C
+(define-auto-insert "\\.c\\'" ["template.c" custom/expand-yasnippet])
+(define-auto-insert "\\.h\\'" ["template.h" custom/expand-yasnippet])
+
+;; C++
+(define-auto-insert "\\.cc\\'" ["template.cc" custom/expand-yasnippet])
+(define-auto-insert "\\.hh\\'" ["template.cc" custom/expand-yasnippet])
+
+;; Python
+(define-auto-insert "\\.py\\'" ["template.py" custom/expand-yasnippet])
+
+
+(provide 'setup-auto-insert-mode)