2 files changed,
25 insertions(+),
0 deletions(-)
Author:
Oleksandr Smirnov
olexsmir@gmail.com
Committed at:
2025-06-24 13:19:58 +0300
Parent:
6ae00d0
jump to
| A | after/ftplugin/todotxt.lua |
| M | filetype.lua |
A
after/ftplugin/todotxt.lua
@@ -0,0 +1,24 @@
+local map = require("core.utils").map + +local function get_date() + return os.date "%Y-%m-%d" +end + +-- add +map("n", "<leader>;a", function() + vim.cmd("put ='" .. get_date() .. " '") + vim.api.nvim_feedkeys("A", "n", false) + vim.cmd "normal! a" +end) + +map("n", "<leader>;d", function() + local row, _ = unpack(vim.api.nvim_win_get_cursor(0)) + local line = vim.api.nvim_buf_get_lines(0, row - 1, row, false)[1] + vim.api.nvim_buf_set_lines( + 0, + row - 1, + row, + false, + { "x " .. get_date() .. " " .. line } + ) +end)
M
filetype.lua
@@ -16,6 +16,7 @@ [".flake8"] = "dosini",
[".editorconfig"] = "dosini", [".stignore"] = "gitignore", ["todo.txt"] = "todotxt", + ["done.txt"] = "todotxt", }, pattern = { ["%.env%.[%w_.-]+"] = "sh",