add shortcut key to isolate markdown tasks
This commit is contained in:
parent
d0c602f5f1
commit
80ecc47399
13
lua/custom_telescope.lua
Normal file
13
lua/custom_telescope.lua
Normal 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
|
@ -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 })
|
||||
|
||||
|
@ -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 = {
|
||||
|
Loading…
Reference in New Issue
Block a user