aboutsummaryrefslogtreecommitdiff
path: root/Emacs
diff options
context:
space:
mode:
authorAryadev Chavali <aryadev@aryadevchavali.com>2020-09-29 17:42:22 +0100
committerAryadev Chavali <aryadev@aryadevchavali.com>2020-09-29 17:42:22 +0100
commit21a6e49b60845502dd4eabd8a36773c7c3905e26 (patch)
treeee1ca2f3c4f227bb25ad713d38362ef2180178f3 /Emacs
parent09ea92f9cc7674cd957437a3a89da5e63201123a (diff)
downloaddotfiles-21a6e49b60845502dd4eabd8a36773c7c3905e26.tar.gz
dotfiles-21a6e49b60845502dd4eabd8a36773c7c3905e26.tar.bz2
dotfiles-21a6e49b60845502dd4eabd8a36773c7c3905e26.zip
(Emacs)-remove insert macro, +hook after-init-hook auto-insert-mode
define-autoinsert basically does what my macro does anyway, also add an auto insert for org mode.
Diffstat (limited to 'Emacs')
-rw-r--r--Emacs/.config/emacs/config.org39
1 files changed, 19 insertions, 20 deletions
diff --git a/Emacs/.config/emacs/config.org b/Emacs/.config/emacs/config.org
index 8bfd6ee..1ebf0b6 100644
--- a/Emacs/.config/emacs/config.org
+++ b/Emacs/.config/emacs/config.org
@@ -839,30 +839,15 @@ Defining some basic skeletons
""
,@skeleton)
(define-abbrev ,table
- ,abbrev-name
+ ,abbrev
""
',skeleton-name)))))
#+end_src
-*** Auto insertion
-Inserting text into new file buffers because templates are cool.
+*** Auto insert
#+begin_src emacs-lisp
-(use-package auto-insert
+(use-package autoinsert
:straight nil
- :hook (find-file-hook . auto-insert)
- :config
- (defmacro +autotyping/create-auto-insert (REGEX DESC SKEL-NAME &rest SKELETON)
- "For a given REGEX with a possible DESC, define a skeleton
-with SKEL-NAME and SKELETON body and bind it to the
-auto-insert-alist"
- `(progn
- (define-skeleton
- ,SKEL-NAME
- ""
- ,@SKELETON)
- (add-to-list
- 'auto-insert-alist
- '((,REGEX . ,DESC)
- ,SKEL-NAME)))))
+ :hook (after-init-hook . auto-insert-mode))
#+end_src
*** Yasnippet default
:PROPERTIES:
@@ -1638,7 +1623,7 @@ use the current buffer?) but it works out.
** Org
*** Org Core Configuration
Hooks, prettify-symbols and my =+org/swiper-goto= to replace the
-vanilla =org-goto=
+vanilla =org-goto=. Also records for auto insertion.
#+begin_src emacs-lisp
(use-package org
:hook
@@ -1649,6 +1634,20 @@ vanilla =org-goto=
org-mode-hook
("#+begin_src" . "≫")
("#+end_src" . "≪")))
+ (with-eval-after-load "autoinsert"
+ (define-auto-insert '("\\.org" . "Org skeleton")
+ '("Enter title: "
+ "#+title: " str | (buffer-file-name) "\n"
+ "#+author: " user-full-name "\n"
+ "#+description: " (setq v1 (read-string "Enter description: ")) | "Description" "\n"
+ "#+options: toc:nil\n\n"
+ "#+begin_center\n"
+ (read-string "Enter further preamble: ")
+ "#+end_center\n"
+ "#+latex: \clearpage\n"
+ "#+toc: headlines\n"
+ "#+latex: \clearpage\n\n"
+ "* " _)))
:config
(with-eval-after-load "swiper"
(defun +org/swiper-goto ()