Skip to content

Directory filter for todo items #623

Closed Answered by abhayk
abhayk asked this question in Q&A
Discussion options

You must be logged in to vote

I figured this out by building on top of some of the examples listed in the filter docs. Basically this works -

todo_personal = {
    mode = "todo",
    filter = function(items)
        return vim.tbl_filter(function(item)
            local sep = package.config:sub(1,1)
            return item.filename:find((vim.loop or vim.uv).cwd() .. sep .. "personal", 1, true)
        end, items)
    end,
},

I have the same function set up for todo_work as well. One pending thing is to define the function only once and have it accept the sub folder as an argument.

But this works for me now. Marking this as resolved.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@abhayk
Comment options

Answer selected by abhayk
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant