Recently Written · git

tmpl

Insanely simple templates

git clone https://github.com/equwal/tmpl

Log | Files | Refs


README.md (1302 bytes)

1 ![template jump <++> on a transparent background](https://therealtruex.com/static/tmpl.webp)
2 
3 Templates for all kinds of things. Just read a file into your editor at the cursor and jump to the `<++>` locations.
4 
5 A [therealtruex.com](https://therealtruex.com) project.
6 
7 vim config:
8 ```
9 map <leader><Space> /<CR><++><BS>
10 ```
11 
12 Here is one such template:
13 ```
14 (defpackage :<++>-system (:use :cl :asdf))
15 (in-package :<++>-system)
16 (defsystem <++>
17   :name "<++>"
18   :author "<++> <<++>@<++>.<++>>"
19   :version "<++>"
20   :maintainer "<++> <<++>@<++>.<++>>"
21   :license "GNU GPLv3.0"
22   :description "<++>"
23   ;; put the most general files first to minimize the "depends on" use
24   ;; and in that case you'll need :serial t
25   :serial <++>
26   :components ((:file "packages")
27                (:file "<++>" :depends-on ("<++>")))
28   :weakly-depends-on (<++>)
29   :depends-on (<++>))
30 ```
31 
32 # Using with Vim
33 
34 ```vim
35 :read /path/to/tmpl/thing
36 ```
37 
38 
39 Make sure to add a templating shortcut to your leader key to jump to
40 the `<++>` spots.
41 ```vim
42     -- Templating shortcut
43     map("n", "<leader><Space>", "/<++><CR>dt>a<BS>", { desc = "Jump to next template placeholder" })
44 ```
45 
46 POSIX shell tricks
47 Many of the shell tricks taken from here:
48 https://www.etalabs.net/sh_tricks.html
49 Especially for-find, a nightmare fixed-point solution.