Skip to main content

Questions tagged [auto-insert]

Question about the usage of package autoinsert

Filter by
Sorted by
Tagged with
0 votes
1 answer

auto-insert-mode picks the wrong template if in $HOME

I created two template files template.c and template.h in my ~/.emacs.d/autoinsert. I have this in my ~/.emacs.d/init.el: ; Insert default content for new files (auto-insert-mode) ;;; Adds hook to ...
Gauthier's user avatar
  • 511
0 votes
1 answer

Move cursor down on auto-insert

#+SETUPFILE: ~/.emacs.d/org-templates/ I have the above line auto-inserted on new org files. Is there a way to make the cursor move to the next line? Now it stays at the beginning of the ...
zeynel's user avatar
  • 371
0 votes
1 answer

Auto insert include guard in cpp header when inside projectile project

I am currently learning C++ and I came across include guards to avoid double inclusion. Now I would like to use the google's style convention like this : // project/src/app.hpp #ifndef ...
johhnry's user avatar
  • 31
1 vote
1 answer

Using auto-insert and yasnippet to insert variables into template

I've been reading this and this, trying to figure out how to have an org-mode in-buffer settings template such as this: # # -*- mode: org -*- # # -*- coding: utf-8 -*- #+TITLE: $1 #+AUTHOR: `(user-...
147pm's user avatar
  • 2,979
1 vote
2 answers

How to increase a magic number in a file buffer on each save

I want to change a magic number (or a time stamp) in a file buffer on each save. The position of the magic number in the buffer can be given through a regex with a keyword or similar. Is there any ...
halloleo's user avatar
  • 1,355
2 votes
1 answer

Autoinsert a python skeleton

I start my python files (.py) with #!/usr/bin/env python3 and sometimes if __name__ == '__main__': somefunc() having done it some hundreds of time manually I decided to automate it in Emacs. (...
Vladimir Zolotykh's user avatar
0 votes
1 answer

auto-insert mode switch to new file

I managed to insert a template to certain sripts with autocomplete. Example: (auto-insert-mode) (setq auto-insert-query nil) (setq auto-insert-alist '(((ess-mode . "R script") nil "# R ...
Krisselack's user avatar
1 vote
0 answers

Both set mode and insert in auto-insert-alist lambda

I have the following as a member of auto-insert-alist: (("/home/robin/.local/bin/.*[^/]\\'" . "Shell-Script mode magic number") lambda nil (if (eq major-mode (default-value 'major-...
Robin Green's user avatar
1 vote
0 answers

Autoinsert inserts template twice

I want to use autoinsert with C and headers, the code from works well so I made my own template for header in an elisp funtion, but the insertion repeat ...
user3593232's user avatar
1 vote
1 answer

Why is autoheader crashing with web-mode?

I got a situation here, that I couldn't get resolved with the maintainer of web-mode. So I'm asking here, if anyone knows a good suggestion. Ok, what I have here: GNU Emacs GUI (version (...
ReneFroger's user avatar
  • 3,910
4 votes
1 answer

How can I quit entering keywords when I auto-insert with Helm?

When I M-x find-file RET file.el RET and then run M-x auto-insert, I am eventually presented with a list of keywords that Helm will complete for me. Trouble is, I have no idea how to finish the Helm ...
Sean Allred's user avatar
  • 6,951
9 votes
1 answer

Best way to make org-mode reload in-buffer settings

I am using auto-insert so that I can get the usual things I use for org mode when opening a new .org file, example: #+AUTHOR: Edgar Aroutiounian #+EMAIL: [email protected] #+STARTUP: ...
c-o-d's user avatar
  • 930
3 votes
1 answer

auto-insert a skeleton and run a function when creating a new file

auto-insert-alist by default matches files created in .../bin/ directories and enables sh-mode. There are examples on the wiki showing how to use a skeleton to insert some text, but I want to both ...
Skeletor's user avatar