Questions tagged [template]

33 questions
31
votes
5 answers

Why do easy templates, .e.g, "< s TAB" in org 9.2 not work?

Easy templates in Org 9.2 are not working for me on GNU Emacs 26.1 (build 1, x86_64-w64-mingw32) of 2018-05-30. I have changed my elpa/ directory to smelpa/. I load emacs -q and switch to the *scratch* buffer and toggle M-x org-mode. A call to …
Lorem Ipsum
  • 4,327
  • 2
  • 14
  • 35
7
votes
2 answers

Template for new file

When opening a new file of certain types, I would like some boilerplate to be inserted. That is, when opening a buffer for a file that does not yet exist, insert some predefined text, optionally with some variable interpolation. Things I can think…
mkaito
  • 741
  • 6
  • 16
6
votes
2 answers

How can I create custom org-mode templates?

I use org-mode to maintain my personal site. Whenever I create a new .org file in my website, I find myself retyping the following #+TITLE: #+OPTIONS: html-postamble:nil whn:nil toc:nil nav:nil #+HTML_HEAD: #+HTML_HEAD_EXTRA: Is it possible to…
Brian Fitzpatrick
  • 2,265
  • 1
  • 17
  • 40
4
votes
1 answer

Is it possible to organize the capture templates selection screen?

As it can be seen above, I have around fifteen capture templates. I think this list may grow or shrink, but in the case that it grows, is there any way to make it more segmented? Like dividing it across some categories, just for visual…
4
votes
2 answers

How to set schedule and deadline for entires being inserted via org-capture template file?

I'm trying to leverage the power of org capture templates. There are a few tasks I know I will be scheduling on particular dates of the month. Setting their schedule and deadline in the capture template automatically would be quiet cool, however I'm…
4
votes
1 answer

Capture template without body

I have an org-formatted file named foo.org that consists only of headings (without body). Notice the absence of blank lines. * one ** a ** b * two ** c * three I want to use capture templates to add a sub-headings (without body) under the…
Ernest A
  • 461
  • 3
  • 10
4
votes
2 answers

Yet another request for Emacs templates

I'd like to find a way to organize and access my (Latex) templates within Emacs and so far, I didn't find a satisfying solution. (This post is related, but doesn't solve my question.) Let's say that I want to typeset some article. Optimally, I would…
Stefan Mesken
  • 245
  • 1
  • 6
3
votes
1 answer

Creating templates in emacs

I need to create a weekly agenda that has the same outline. I currently have a Word template file that I use, but would like to convert it to emacs. I want the emacs "template" to pre-fill the common text and present me with fields for updating…
tomcat
  • 345
  • 1
  • 9
2
votes
1 answer

Evaluate a variable when inserting text into a buffer

When I open a fresh file for coding, I like to insert a header like this: ##################################################################### # Purpose: # Author: me (me@someplace.com) #…
Dan
  • 191
  • 5
2
votes
1 answer

How to run functions inside auto-insert template

I have this in my init file (use-package autoinsert :ensure t :init ;; Don't want to be prompted before insertion: (setq auto-insert-query nil) (setq auto-insert-directory (locate-user-emacs-file "templates")) (add-hook 'find-file-hook…
147pm
  • 2,907
  • 1
  • 18
  • 39
2
votes
2 answers

Looking for an existing function for find-file-not-found-functions to do form style creation

I have the habit when creating larger projects to make files called skeleton.typ with all the standard boilerplate for a file of that type (e.g. copyright notices, licenses, the standard html/head/title/body/etc. tags for a web page, #includes for a…
MAP
  • 582
  • 4
  • 11
1
vote
1 answer

Org-capture template extension with project name

I am struggling to setup an org-capture template which captures the current projects name from where it is called. Just like ‘%f’ File visited by current buffer when org-capture was called. I am looking for Project visited by current buffer when…
grszkthfr
  • 80
  • 6
1
vote
1 answer

How to disable template insertion for `val`, `let`, etc. in `sml-mode`?

With the latest sml-mode(as of ELPA Jan 2022, Emacs 27), Emacs always creates some kind of pattern after a keyword such as val, fun and let and whitespace. So, if I type fun , I get fun = ^ where ^ indicates the cursor position. I appreciate the…
tinlyx
  • 1,276
  • 1
  • 12
  • 27
1
vote
2 answers

Yasnippet conditional template depending on field value

I'm having an issue where I would like to be able to create a template which will conditionally insert a string into the template based on the value of one of the fields. This means I want some sort of embedded elisp (or elisp function call) to…
1
vote
1 answer

Org mode HTML export presets

When I export something with org mode to html, with it comes a load of presets such as id, labels, classes, preambles and post ambles. For example:
I would like to remove all of this or to at…
1
2 3