File tree 1 file changed +20
-0
lines changed
1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -81,6 +81,26 @@ When you use `Telescope neorg find_aof_project_tasks` you can pick an area of fo
81
81
<video alt =" find_aof_project_tasks " src =" https://user-images.githubusercontent.com/81827001/158401841-9ca3a311-bac1-4733-9a6e-6125003d8a38.mov " ></video >
82
82
</details >
83
83
84
+ Until the new GTD infrastructure arrives, you could collect all your todo items with a regex, for example:
85
+
86
+ ``` lua
87
+ -- Make sure you have ripgrep installed.
88
+ -- Add the following function to your `~/.config/nvim/init.lua`:
89
+ do
90
+ local _ , neorg = pcall (require , " neorg.core" )
91
+ local dirman = neorg .modules .get_module (" core.dirman" )
92
+ local function get_todos (dir , states )
93
+ local current_workspace = dirman .get_current_workspace ()
94
+ local dir = current_workspace [2 ]
95
+ require (' telescope.builtin' ).live_grep { cwd = dir }
96
+ vim .fn .feedkeys (' ^ *([*]+|[-]+) +[(]' .. states .. ' [)]' )
97
+ end
98
+
99
+ -- This can be bound to a key
100
+ vim .keymap .set (' n' , ' <c-t>' , function () get_todos (' ~/notes' , ' [^x_]' ) end )
101
+ end
102
+ ```
103
+
84
104
# 🔧 Installation
85
105
First, make sure to pull this plugin down. This plugin does not run any code in of itself. It requires Neorg
86
106
to load it first:
You can’t perform that action at this time.
0 commit comments