add shortcut key to isolate markdown tasks

This commit is contained in:
Paul Trowbridge 2024-10-14 09:09:06 -04:00
parent d0c602f5f1
commit 80ecc47399
3 changed files with 31 additions and 0 deletions

13
lua/custom_telescope.lua Normal file
View File

@ -0,0 +1,13 @@
local telescope = require('telescope.builtin')
local M = {}
function M.search_markdown_tasks()
telescope.grep_string({
prompt_title = "Markdown Tasks",
search = "- [ ]", -- Customize if needed for specific task markers
cwd = vim.fn.expand('%:p:h') -- Current file's directory
})
end
return M

View File

@ -8,3 +8,9 @@ map("n", ";", ":", { desc = "CMD enter command mode" })
map("i", "jk", "<ESC>")
-- map({ "n", "i", "v" }, "<C-s>", "<cmd> w <cr>")
local custom_telescope = require('custom_telescope')
-- Add a keybinding for searching Markdown tasks
vim.api.nvim_set_keymap('n', '<leader>mt', ':lua require("custom_telescope").search_markdown_tasks()<CR>', { noremap = true, silent = true })

View File

@ -13,6 +13,18 @@ return {
end,
},
{
'nvim-telescope/telescope.nvim',
requires = { {'nvim-lua/plenary.nvim'} },
config = function()
require('telescope').setup {
defaults = {
-- Your default configuration for Telescope (optional)
}
}
end
},
-- {
-- "nvim-treesitter/nvim-treesitter",
-- opts = {