Search for TODO comments with Telescope
This commit is contained in:
parent
40e05c6f70
commit
ef439aefd1
|
@ -140,6 +140,23 @@ function M.oldfiles()
|
|||
require("telescope").extensions.frecency.frecency(opts)
|
||||
end
|
||||
|
||||
function M.search_todos()
|
||||
local opts = {
|
||||
search = "TODO",
|
||||
search_dirs = {
|
||||
"app",
|
||||
"docroot/modules/custom",
|
||||
"docroot/themes/custom",
|
||||
"src",
|
||||
"web/modules/custom",
|
||||
"web/themes/custom",
|
||||
},
|
||||
prompt_title = "TODOs",
|
||||
}
|
||||
|
||||
require("telescope.builtin").grep_string(opts)
|
||||
end
|
||||
|
||||
return setmetatable({}, {
|
||||
__index = function(_, k)
|
||||
reloader()
|
||||
|
|
|
@ -32,6 +32,7 @@ telescope_mapper("<leader>sg", "git_files") -- [S]earch [G]it Files
|
|||
telescope_mapper("<leader>sh", "help_tags") -- [S]earch [H]elp
|
||||
telescope_mapper("<leader>sl", "live_grep") -- [S]earch using [L]ive grep
|
||||
telescope_mapper("<leader>sp", "grep_prompt") -- [S]earch using grep [P]rompt
|
||||
telescope_mapper("<leader>st", "search_todos") -- [S]earch using grep [P]rompt
|
||||
|
||||
local builtin = require "telescope.builtin"
|
||||
local telescope = require "telescope"
|
||||
|
|
Reference in a new issue