summaryrefslogtreecommitdiff
path: root/after/ftplugin/html.lua
diff options
context:
space:
mode:
Diffstat (limited to 'after/ftplugin/html.lua')
-rw-r--r--after/ftplugin/html.lua19
1 files changed, 16 insertions, 3 deletions
diff --git a/after/ftplugin/html.lua b/after/ftplugin/html.lua
index 3a318c8..fc89319 100644
--- a/after/ftplugin/html.lua
+++ b/after/ftplugin/html.lua
@@ -6,15 +6,15 @@ function Snippets(snipType, value)
elseif snipType == "tag" then
snippet = string.format("<%s></%s>", value, value)
elseif snipType == "linebreak" then
- snippet = [[</br>]]
+ snippet = [[<br>]]
elseif snipType == "hrline" then
- snippet = [[<hr/>]]
+ snippet = [[<hr>]]
elseif snipType == "link" then
snippet = string.format([[<a href="%s">%s</a>]],
value["url"], value["label"]
)
elseif snipType == "pieces" then
- if value == "document" then
+ if value == "init" then
snippet = [[
<!DOCTYPE html>
<html>
@@ -34,6 +34,18 @@ html {
}
</style>
]]
+ elseif value == "cjHeader" then
+ snippet = string.format([[
+<section>
+ <h1>_title_</h1>
+ <p>
+ <i>_subtitle_</i><br>
+ %s<br>
+ <a href="index.html">The Cursory Journal</a>
+ <hr>
+ </p>
+</section>
+ ]], os.date("%Y/%m/%d"))
end
end
return snippet
@@ -84,6 +96,7 @@ vim.keymap.set('i', "<M-s><M-l>", function()
JumpInTag()
end, {remap=true})
+
vim.keymap.set('i', "<M-s><M-d>", function()
dt = os.date("%Y/%m/%d")
WriteText(dt)