@@ -86,7 +86,7 @@ CONTENTS *orgmode-content
86
86
1.3.3.2. org_capture_refile...............|orgmode-org_capture_refile|
87
87
1.3.3.3. org_capture_kill...................|orgmode-org_capture_kill|
88
88
1.3.3.4. org_capture_show_help.........|orgmode-org_capture_show_help|
89
- 1.3.4. Closing note mappings...............|orgmode-closing_note_mappings |
89
+ 1.3.4. Note mappings............................... |orgmode-note_mappings |
90
90
1.3.4.1. org_note_finalize.................|orgmode-org_note_finalize|
91
91
1.3.4.2. org_note_kill.........................|orgmode-org_note_kill|
92
92
1.3.4.3. org_note_show_help...............|orgmode-org_note_show_help|
@@ -157,8 +157,10 @@ CONTENTS *orgmode-content
157
157
1.7. Autocompletion...................................|orgmode-autocompletion|
158
158
1.8. Abbreviations.....................................|orgmode-abbreviations|
159
159
1.9. Formatting...........................................|orgmode-formatting|
160
- 1.10. Colors..................................................|orgmode-colors|
161
- 1.10.1. Highlight Groups........................|orgmode-highlight_groups|
160
+ 1.10. User interface..................................|orgmode-user_interface|
161
+ 1.10.1. Colors............................................|orgmode-colors|
162
+ 1.10.1.1. Highlight Groups..................|orgmode-highlight_groups|
163
+ 1.10.2. Menu................................................|orgmode-menu|
162
164
1.11. Advanced search................................|orgmode-advanced_search|
163
165
1.12. Notifications (experimental)......|orgmode-notifications_(experimental)|
164
166
1.12.1. Cron................................................|orgmode-cron|
@@ -199,7 +201,9 @@ TABLE OF CONTENT *orgmode-table_of_conten
199
201
7. Autocompletion (#autocompletion)
200
202
8. Abbreviations (#abbreviations)
201
203
9. Formatting (#formatting)
202
- 10. Colors (#colors)
204
+ 10. User interface (#user-interface)
205
+ 1. Colors (#colors)
206
+ 2. Menu (#menu)
203
207
11. Advanced search (#advanced-search)
204
208
12. Notifications (experimental) (#notifications-experimental)
205
209
13. Clocking (#clocking)
@@ -1021,7 +1025,7 @@ These mappings live under `mappings.capture`, and can be changed like this:
1021
1025
})
1022
1026
<
1023
1027
1024
- CLOSING NOTE MAPPINGS *orgmode-closing_note_mappings *
1028
+ NOTE MAPPINGS *orgmode-note_mappings *
1025
1029
1026
1030
Mappings used in closing note window.
1027
1031
@@ -1528,6 +1532,8 @@ Currently, these things are formatted:
1528
1532
* Clock entries total time is recalculated (see Recalculating totals (#recalculating-totals) in Clocking (#Clocking) section)
1529
1533
1530
1534
--------------------------------------------------------------------------------
1535
+ USER INTERFACE *orgmode-user_interface*
1536
+
1531
1537
COLORS *orgmode-colors*
1532
1538
1533
1539
Colors used for todo keywords and agenda states (deadline, schedule ok, schedule warning)
@@ -1585,6 +1591,73 @@ HIGHLIGHT GROUPS *orgmode-highlight_group
1585
1591
* `OrgAgendaScheduled`: A scheduled item in the agenda view
1586
1592
* `OrgAgendaScheduledPast`: A item past its scheduled date in the agenda view
1587
1593
1594
+ MENU *orgmode-menu*
1595
+
1596
+ The menu is used when selecting further actions in `agenda`, `capture` and `export`. Here is an example of the menu you see when opening `agenda`:
1597
+ >
1598
+ Press key for an agenda command
1599
+ -------------------------------
1600
+ a Agenda for current week or day
1601
+ t List of all TODO entries
1602
+ m Match a TAGS/PROP/TODO query
1603
+ M Like m, but only for TODO entries
1604
+ s Search for keywords
1605
+ q Quit
1606
+ <
1607
+
1608
+ Users have the option to change the appearance of this menu. To do this, you need to add a handler in the UI configuration section:
1609
+ >
1610
+ require("orgmode").setup({
1611
+ ui = {
1612
+ menu = {
1613
+ handler = function(data)
1614
+ -- your handler here, for example:
1615
+ local options = {}
1616
+ local options_by_label = {}
1617
+ for _, item in ipairs(data.items) do
1618
+ -- Only MenuOption has `key`
1619
+ -- Also we don't need `Quit` option because we can close the menu with ESC
1620
+ if item.key and item.label:lower() ~= "quit" then
1621
+ table.insert(options, item.label)
1622
+ options_by_label[item.label] = item
1623
+ end
1624
+ end
1625
+ local handler = function(choice)
1626
+ if not choice then
1627
+ return
1628
+ end
1629
+ local option = options_by_label[choice]
1630
+ if option.action then
1631
+ option.action()
1632
+ end
1633
+ end
1634
+ vim.ui.select(options, {
1635
+ propmt = data.propmt,
1636
+ }, handler)
1637
+ end,
1638
+ },
1639
+ },
1640
+ })
1641
+ <
1642
+
1643
+ When the menu is called, the handler receives a table `data` with the following fields as input:
1644
+ * `title` (`string`) — menu title
1645
+ * `items` (`table`) — array containing `MenuItem` (see below)
1646
+ * `prompt` (`string`) — prompt text used to prompt a keystroke
1647
+
1648
+ Each menu item `MenuItem` is one of two types: `MenuOption` and `MenuSeparator`.
1649
+
1650
+ `MenuOption` is a table containing the following fields:
1651
+ * `label` (`string`) — description of the action
1652
+ * `key` (`string`) — key that will be processed when the keys are pressed in the menu
1653
+ * `action` (`function` optional) — handler that will be called when the `key` is pressed in the menu.
1654
+
1655
+ `MenuSeparator` is a table containing the following fields:
1656
+ * `icon` (`string` optional) — character used as separator. The default character is `-`
1657
+ * `length` (`number` optional) — number of repetitions of the separator character. The default length is 80
1658
+
1659
+ In order for the menu to work as expected, the handler must call `action` from `MenuItem`.
1660
+
1588
1661
--------------------------------------------------------------------------------
1589
1662
ADVANCED SEARCH *orgmode-advanced_search*
1590
1663
0 commit comments