diff options
| -rw-r--r-- | after/ftplugin/html.lua | 19 | ||||
| -rw-r--r-- | init.lua | 4 |
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) @@ -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) |
