feat: add todo.txt support.
This commit is contained in:
parent
d832161919
commit
475b794b98
3 changed files with 46 additions and 0 deletions
|
|
@ -5,3 +5,4 @@ require("plugins.mini")
|
|||
require("plugins.mini.init")
|
||||
require("plugins.markdown")
|
||||
require("plugins.conform")
|
||||
require("plugins.todotxt")
|
||||
|
|
|
|||
41
lua/plugins/todotxt.lua
Normal file
41
lua/plugins/todotxt.lua
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
vim.pack.add({
|
||||
{ src = "https://github.com/phrmendes/todotxt.nvim" },
|
||||
})
|
||||
|
||||
require("todotxt").setup({
|
||||
todotxt = vim.env.HOME .. "/docs/sb/todo/todo.txt",
|
||||
donetxt = vim.env.HOME .. "/docs/sb/todo/done.txt",
|
||||
ghost_text = {
|
||||
enable = true,
|
||||
mappings = {
|
||||
["(A)"] = "now", -- High priority tasks
|
||||
["(B)"] = "next", -- Medium priority tasks
|
||||
["(C)"] = "today", -- Lower priority tasks
|
||||
["(D)"] = "tomorrow", -- Even lower priority
|
||||
["(E)"] = "this week",
|
||||
["(F)"] = "next week",
|
||||
},
|
||||
prefix = " ", -- Text prefix
|
||||
highlight = "Comment", -- Highlight group
|
||||
}
|
||||
})
|
||||
|
||||
vim.filetype.add({
|
||||
filename = {
|
||||
["todo.txt"] = "todotxt",
|
||||
["done.txt"] = "todotxt",
|
||||
},
|
||||
})
|
||||
|
||||
vim.keymap.set("n", "<leader>tn", "<cmd>TodoTxt new<cr>", { desc = "New todo entry" })
|
||||
vim.keymap.set("n", "<leader>tt", "<cmd>TodoTxt<cr>", { desc = "Toggle todo.txt" })
|
||||
vim.keymap.set("n", "<leader>td", "<cmd>DoneTxt<cr>", { desc = "Toggle done.txt" })
|
||||
vim.keymap.set("n", "<leader>tg", "<cmd>TodoTxt ghost<cr>", { desc = "Toggle ghost text" })
|
||||
vim.keymap.set("n", "<cr>", "<Plug>(TodoTxtToggleState)", { desc = "Toggle task state" })
|
||||
vim.keymap.set("n", "<c-c>n", "<Plug>(TodoTxtCyclePriority)", { desc = "Cycle priority" })
|
||||
vim.keymap.set("n", "<leader>tm", "<Plug>(TodoTxtMoveDone)", { desc = "Move done tasks" })
|
||||
vim.keymap.set("n", "<leader>tss", "<Plug>(TodoTxtSortTasks)", { desc = "Sort tasks (default)" })
|
||||
vim.keymap.set("n", "<leader>tsp", "<Plug>(TodoTxtSortByPriority)", { desc = "Sort by priority" })
|
||||
vim.keymap.set("n", "<leader>tsc", "<Plug>(TodoTxtSortByContext)", { desc = "Sort by context" })
|
||||
vim.keymap.set("n", "<leader>tsP", "<Plug>(TodoTxtSortByProject)", { desc = "Sort by project" })
|
||||
vim.keymap.set("n", "<leader>tsd", "<Plug>(TodoTxtSortByDueDate)", { desc = "Sort by due date" })
|
||||
|
|
@ -35,6 +35,10 @@
|
|||
"rose-pine": {
|
||||
"rev": "cf2a288696b03d0934da713d66c6d71557b5c997",
|
||||
"src": "https://github.com/rose-pine/neovim"
|
||||
},
|
||||
"todotxt.nvim": {
|
||||
"rev": "f514ac34a491a01be3eeb2827aace06505032d38",
|
||||
"src": "https://github.com/phrmendes/todotxt.nvim"
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue