We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
read the title for gtd tasks would be useful for integrations like e.g. https://github.com/max397574/neorg-kanban
Yes
something I tried out
local states = { ["undone"] = { "%- %[ %] ", "NeorgTodoItem1Undone" }, ["done"] = { "%- %[x%] ", "NeorgTodoItem1Done" }, ["pending"] = { "%- %[%-%] ", "NeorgTodoItem1Pending" }, ["cancelled"] = { "%- %[%_%] ", "NeorgTodoItem1Cancelled" }, ["uncertain"] = { "%- %[%?%] ", "NeorgTodoItem1Uncertain" }, ["urgent"] = { "%- %[%!%] ", "NeorgTodoItem1Urgent" }, ["recurring"] = { "%- %[%+%] ", "NeorgTodoItem1Recurring" }, ["on_hold"] = { "%- %[=%] ", "NeorgTodoItem1OnHold" }, } local ts_utils = require("nvim-treesitter.ts_utils") ---@diagnostic disable: undefined-global pcall(vim.cmd, "NeorgStart silent=true") local tasks_raw = neorg.modules.get_module("core.gtd.queries").get("tasks") tasks_raw = neorg.modules.get_module("core.gtd.queries").add_metadata( tasks_raw, "task" ) -- local tasks_raw = neorg.modules.get_module("core.gtd.queries").get("projects") -- tasks_raw = neorg.modules.get_module("core.gtd.queries").add_metadata(tasks_raw, "project") -- vim.pretty_print(tasks_raw) local uuid = tasks_raw[1].uuid local state_new = "done" for _, task in ipairs(tasks_raw) do if task.uuid == uuid then vim.pretty_print(task) vim.fn.bufload(task.internal.bufnr) local old_state = states[task.state][1] if state_new == old_state then break end -- ts_utils.goto_node(task.internal.node, false, true) local new_state = states[state_new][1] local s_row, s_col, e_row, e_col = ts_utils.get_node_range( task.internal.node ) local line = vim.api.nvim_buf_get_lines( task.internal.bufnr, s_row, e_row, false )[1] line = line:gsub(old_state, new_state) vim.api.nvim_buf_set_lines( task.internal.bufnr, s_row, s_row + 1, false, { line } ) vim.api.nvim_buf_call(task.internal.bufnr, function() vim.cmd("write!") end) vim.cmd([[bunload ]] .. task.internal.bufnr) end end
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Issues
Feature description
read the title
for gtd tasks
would be useful for integrations like e.g. https://github.com/max397574/neorg-kanban
Help
Yes
Implementation help
something I tried out
The text was updated successfully, but these errors were encountered: