@@ -77,6 +77,12 @@ require('telescope').extensions.orgmode.insert_link
77
77
By pressing ` <C-Space> ` the picker state can be toggled between two modes.
78
78
Every mode is available in every function.
79
79
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
+
80
86
### Search headlines
81
87
82
88
This 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
116
122
require (' telescope' ).extension .orgmode .search_headings ({ max_depth = 3 })
117
123
```
118
124
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:
120
145
121
146
``` lua
122
- vim .set .keymap (
147
+ -- Search only org files
148
+ vim .keymap .set (
123
149
" n" ,
124
- " <Leader>off" ,
150
+ " <Leader>off" ,
125
151
function ()
126
- require (' telescope' ).extension .orgmode .search_headings ({ mode = " orgfiles" })
152
+ require (' telescope' ).extensions .orgmode .search_headings ({ mode = " orgfiles" })
127
153
end ,
128
154
{ desc = " Find org files" }
129
155
)
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
+ )
130
166
```
0 commit comments