summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortalha <->2025-12-06 15:09:52 +0500
committertalha <->2025-12-06 15:09:52 +0500
commit03c63bf3bb3d2c93dac0bb481a7be6b4251c3e6e (patch)
tree982697c009c3dd62e0454a11636e261771fbce6e
parent66cecf10657d4ce38d95e8f3085fb09e90a7f602 (diff)
Added snippet, minor updates to configmaster
-rw-r--r--after/ftplugin/html.lua19
-rw-r--r--init.lua4
2 files changed, 18 insertions, 5 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)
diff --git a/init.lua b/init.lua
index e061d87..4b67e5b 100644
--- a/init.lua
+++ b/init.lua
@@ -22,7 +22,7 @@ vim.opt.cursorline = true
vim.opt.scrolloff = 8
vim.opt.updatetime = 50
vim.opt.linebreak = false
-vim.cmd[[let &showbreak = "> "]]
+vim.cmd[[let &showbreak = "←"]]
if vim.fn.executable('rg') > 0 then
vim.opt.grepprg = 'rg --vimgrep'
@@ -103,7 +103,7 @@ function WriteLines(toWrite)
end
local posYX = vim.api.nvim_win_get_cursor(0)
print(posYX[0], posYX[1], posYX[2])
- vim.api.nvim_buf_set_lines(0, posYX[1]-1, posYX[2], true, toWrite)
+ vim.api.nvim_buf_set_lines(0, posYX[1]-1, posYX[1]-1, true, toWrite)
end
function StrSplit(inpstr, sep)