@@ -77,6 +77,12 @@ require('telescope').extensions.orgmode.insert_link
7777By pressing ` <C-Space> ` the picker state can be toggled between two modes.
7878Every mode is available in every function.
7979
80+ ### Current file only mode
81+
82+ In headline mode, you can press ` <C-f> ` to toggle between showing all headlines
83+ vs only headlines from the current file. This is useful when you want to focus
84+ on the current file's structure.
85+
8086### Search headlines
8187
8288This is the first and default mode. It shows all the headlines, initially
@@ -116,15 +122,45 @@ For a particular command you can pass it directly in your key mapping to the fun
116122require (' telescope' ).extension .orgmode .search_headings ({ max_depth = 3 })
117123```
118124
119- You can also create a key mapping, that allows you to search directly for org files:
125+ ### Custom keymaps
126+
127+ You can customize the telescope picker keymaps by passing a ` mappings ` table:
128+
129+ ``` lua
130+ require (' telescope' ).extensions .orgmode .search_headings ({
131+ mappings = {
132+ i = {
133+ [' <C-l>' ] = require (' telescope-orgmode.actions' ).toggle_current_file_only ,
134+ [' <C-s>' ] = require (' telescope-orgmode.actions' ).toggle_headlines_orgfiles ,
135+ },
136+ n = {
137+ [' <C-l>' ] = require (' telescope-orgmode.actions' ).toggle_current_file_only ,
138+ [' <C-s>' ] = require (' telescope-orgmode.actions' ).toggle_headlines_orgfiles ,
139+ }
140+ }
141+ })
142+ ```
143+
144+ You can also create key mappings for specific modes:
120145
121146``` lua
122- vim .set .keymap (
147+ -- Search only org files
148+ vim .keymap .set (
123149 " n" ,
124- " <Leader>off" ,
150+ " <Leader>off" ,
125151 function ()
126- require (' telescope' ).extension .orgmode .search_headings ({ mode = " orgfiles" })
152+ require (' telescope' ).extensions .orgmode .search_headings ({ mode = " orgfiles" })
127153 end ,
128154 { desc = " Find org files" }
129155)
156+
157+ -- Search headlines in current file only
158+ vim .keymap .set (
159+ " n" ,
160+ " <Leader>ofc" ,
161+ function ()
162+ require (' telescope' ).extensions .orgmode .search_headings ({ only_current_file = true })
163+ end ,
164+ { desc = " Find headlines in current file" }
165+ )
130166```
0 commit comments