Skip to content

Commit 5acb84d

Browse files
committed
[guide] Add guide to menu
1 parent 803d32e commit 5acb84d

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

visidata/features/menu_guide.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
from visidata import GuideSheet, vd
2+
3+
class MenuGuide(GuideSheet):
4+
guide_text = '''# The Menu System
5+
6+
Located at the [:black on 68]very top of the screen[/], it contains a collection of commands organised within submenu trees.
7+
8+
The menu can be navigated both as a standard, clickable GUI menu, and via keystrokes.
9+
10+
To navigate via keystrokes, `Alt+H` will open the **Help** menu, and from there `↑ ↓ → ←` keys can be used to move between submenus.
11+
12+
Additionally, each top-level menu name has a single letter underlined. `Alt+<underlined letter>` will open that menu. For example, `Alt+F` will open the **File** menu.
13+
14+
`{vd.options.disp_menu_more}` indicates a submenu, which can be traversed with the `→` or a mouse-click. The leaf node of every menu tree is a command.
15+
16+
When the cursor is on a command, the menu throws up its [:color_menu_help]helpbox[/]. This contains the description of the command, the keyboard shortcut if available, and its command longname. Clicking on the command in the menu, or pressing `Enter`, will execute the actual command.
17+
18+
`{vd.options.disp_menu_push}` indicates that the command will push a sheet onto sheet stack. `{vd.options.disp_menu_input}` indicates that input will be required for the command.
19+
20+
[:color_menu_spec]Sheet-specific commands[/] will only appear in the menu when that specific sheet type is loaded.
21+
22+
## Options
23+
24+
- {help.options.disp_menu}
25+
- {help.options.disp_menu_fmt}
26+
- {help.options.color_menu}
27+
'''
28+
29+
vd.addGuide('MenuGuide', MenuGuide)

0 commit comments

Comments
 (0)