vimamsa 0.1.27 → 0.1.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (156) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +139 -89
  3. data/custom_example.rb +18 -6
  4. data/doc/TODO.md +327 -110
  5. data/doc/action_names_plan.md +442 -0
  6. data/doc/bundling_plan.md +2 -1
  7. data/doc/delta_syntax_plan.md +293 -0
  8. data/doc/demo_recording_plan.md +288 -0
  9. data/doc/design_goals.md +27 -0
  10. data/doc/intro_page_plan.md +266 -0
  11. data/doc/key_bindings_report_plan.md +45 -0
  12. data/doc/line_tree_plan.md +89 -0
  13. data/doc/missing_vim_bindings.md +34 -44
  14. data/doc/modules_settings_plan.md +1 -1
  15. data/doc/registries_plan.md +202 -0
  16. data/doc/startup_speed_plan.md +97 -0
  17. data/doc/treap_visualizer.html +585 -0
  18. data/doc/vim_compatibility_plan.md +186 -31
  19. data/doc/vimlike_vim_conflicts.md +236 -228
  20. data/doc/vm_snapshots_plan.md +4 -4
  21. data/doc/wysiwyg_plan.md +231 -0
  22. data/exe/run_tests.rb +8 -1
  23. data/exe/vimamsa +49 -6
  24. data/help/intro.txt +30 -0
  25. data/help/vim_intro.txt +31 -0
  26. data/img/demo.gif +0 -0
  27. data/img/demo.mp4 +0 -0
  28. data/lang/hyperplaintext.lang +1 -1
  29. data/lib/vimamsa/ack.rb +2 -0
  30. data/lib/vimamsa/actions.rb +381 -36
  31. data/lib/vimamsa/bookmarks.rb +8 -8
  32. data/lib/vimamsa/buffer.rb +83 -37
  33. data/lib/vimamsa/buffer_changetext.rb +58 -36
  34. data/lib/vimamsa/buffer_list.rb +2 -2
  35. data/lib/vimamsa/buffer_manager.rb +6 -6
  36. data/lib/vimamsa/cli_help.rb +75 -0
  37. data/lib/vimamsa/clipboard.rb +6 -3
  38. data/lib/vimamsa/conf.rb +9 -0
  39. data/lib/vimamsa/crash_handler.rb +2 -2
  40. data/lib/vimamsa/debug.rb +2 -2
  41. data/lib/vimamsa/demo_player.rb +458 -0
  42. data/lib/vimamsa/demo_recorder.rb +277 -0
  43. data/lib/vimamsa/diff_buffer.rb +1 -1
  44. data/lib/vimamsa/dot_repeat.rb +104 -0
  45. data/lib/vimamsa/easy_jump.rb +54 -3
  46. data/lib/vimamsa/editor.rb +89 -46
  47. data/lib/vimamsa/file_history.rb +1 -1
  48. data/lib/vimamsa/file_manager.rb +23 -23
  49. data/lib/vimamsa/form_input.rb +388 -0
  50. data/lib/vimamsa/gui.rb +83 -13
  51. data/lib/vimamsa/gui_command_line.rb +44 -5
  52. data/lib/vimamsa/gui_form_generator.rb +17 -6
  53. data/lib/vimamsa/gui_key_hint.rb +165 -0
  54. data/lib/vimamsa/gui_keylog_panel.rb +164 -2
  55. data/lib/vimamsa/gui_menu.rb +69 -50
  56. data/lib/vimamsa/gui_select_window.rb +77 -43
  57. data/lib/vimamsa/gui_settings.rb +9 -5
  58. data/lib/vimamsa/gui_sourceview.rb +15 -81
  59. data/lib/vimamsa/gui_theme.rb +11 -2
  60. data/lib/vimamsa/hook.rb +2 -0
  61. data/lib/vimamsa/intro_page.rb +368 -0
  62. data/lib/vimamsa/key_actions.rb +315 -225
  63. data/lib/vimamsa/key_binding_tree.rb +228 -61
  64. data/lib/vimamsa/key_bindings_notepad.rb +18 -16
  65. data/lib/vimamsa/key_bindings_report.rb +290 -67
  66. data/lib/vimamsa/key_bindings_vim.rb +47 -297
  67. data/lib/vimamsa/key_bindings_vimlike.rb +347 -339
  68. data/lib/vimamsa/key_names.rb +80 -0
  69. data/lib/vimamsa/line_tree.rb +367 -0
  70. data/lib/vimamsa/macro.rb +20 -3
  71. data/lib/vimamsa/rbvma.rb +15 -0
  72. data/lib/vimamsa/registers.rb +125 -0
  73. data/lib/vimamsa/run_ruby.rb +64 -0
  74. data/lib/vimamsa/search_replace.rb +4 -4
  75. data/lib/vimamsa/string_util.rb +17 -3
  76. data/lib/vimamsa/tests.rb +8 -8
  77. data/lib/vimamsa/text_objects.rb +11 -54
  78. data/lib/vimamsa/text_transforms.rb +4 -0
  79. data/lib/vimamsa/tmp_user_dir.rb +39 -0
  80. data/lib/vimamsa/user_dirs.rb +83 -0
  81. data/lib/vimamsa/version.rb +1 -1
  82. data/lib/vimamsa/vim_core.rb +355 -0
  83. data/lib/vimamsa/vim_operators.rb +365 -0
  84. data/modules/calculator/calculator.rb +5 -5
  85. data/modules/color_highlight/color_highlight.rb +3 -3
  86. data/modules/dictation/dictation.rb +32 -32
  87. data/modules/ollama/ollama.rb +5 -5
  88. data/modules/terminal/terminal.rb +5 -5
  89. data/modules/tts/tts.rb +10 -10
  90. data/run_e2e_vm.sh +3 -3
  91. data/run_tests_vm.rb +138 -0
  92. data/scripts/demo/demo_easyjump_steps.txt +60 -0
  93. data/scripts/demo/demo_files_steps.txt +52 -0
  94. data/scripts/demo/demo_steps.txt +9 -1
  95. data/scripts/demo/notes.txt +6 -0
  96. data/scripts/demo/record_demo.rb +60 -81
  97. data/scripts/demo/report.rb +7 -0
  98. data/scripts/demo/shapes.rb +1 -0
  99. data/scripts/demo/square/shapes.rb +29 -0
  100. data/scripts/demo/square/steps.txt +185 -0
  101. data/scripts/lib/perf_startup.rb +138 -0
  102. data/scripts/lib/script_helpers.rb +53 -0
  103. data/scripts/perf_compare.rb +34 -0
  104. data/scripts/profile_startup.rb +72 -0
  105. data/tests/test_action_ids.rb +232 -0
  106. data/tests/test_auto_format.rb +2 -2
  107. data/tests/test_autocomplete.rb +1 -1
  108. data/tests/test_basic_editing.rb +18 -18
  109. data/tests/test_bookmarks.rb +6 -6
  110. data/tests/test_bracket_match.rb +3 -0
  111. data/tests/test_cli_help.rb +64 -0
  112. data/tests/test_color_highlight.rb +2 -2
  113. data/tests/test_command_line.rb +1 -1
  114. data/tests/test_context_menu_file.rb +18 -0
  115. data/tests/test_copy_paste.rb +33 -33
  116. data/tests/test_custom_two_phase.rb +1 -1
  117. data/tests/test_demo_player.rb +301 -0
  118. data/tests/test_demo_recorder.rb +202 -0
  119. data/tests/test_dictation.rb +16 -16
  120. data/tests/test_dot_repeat.rb +88 -0
  121. data/tests/test_easy_jump.rb +93 -0
  122. data/tests/test_extract_file_links.rb +3 -3
  123. data/tests/test_file_panel.rb +2 -2
  124. data/tests/test_flash.rb +1 -1
  125. data/tests/test_fold.rb +1 -1
  126. data/tests/test_form_input.rb +203 -0
  127. data/tests/test_func_panel.rb +2 -2
  128. data/tests/test_gtk_sync.rb +7 -7
  129. data/tests/test_intro_page.rb +437 -0
  130. data/tests/test_key_categories.rb +163 -0
  131. data/tests/test_keylog_panel.rb +163 -3
  132. data/tests/test_line_ends.rb +51 -0
  133. data/tests/test_line_tree.rb +86 -0
  134. data/tests/test_lsp_clangd.rb +2 -2
  135. data/tests/test_macro.rb +2 -2
  136. data/tests/test_module_interface.rb +9 -9
  137. data/tests/test_notepad_bindings.rb +5 -5
  138. data/tests/test_perf_startup.rb +28 -0
  139. data/tests/test_random_edit.rb +27 -27
  140. data/tests/test_registers.rb +122 -0
  141. data/tests/test_run_ruby.rb +77 -0
  142. data/tests/test_startup_file.rb +1 -1
  143. data/tests/test_text_objects.rb +1 -1
  144. data/tests/test_text_transforms.rb +12 -0
  145. data/tests/test_tmp_user_dir.rb +79 -0
  146. data/tests/test_tts.rb +10 -10
  147. data/tests/test_undo.rb +34 -34
  148. data/tests/test_user_dirs.rb +122 -0
  149. data/tests/test_vim_bindings.rb +107 -6
  150. data/tests/test_vim_conflicts.rb +41 -4
  151. data/tests/test_vim_operators.rb +116 -0
  152. data/tests/test_window_layout.rb +83 -0
  153. data/vimamsa.gemspec +1 -1
  154. data/vm_guest_run.sh +22 -2
  155. metadata +58 -3
  156. data/run_tests_vm.sh +0 -130
@@ -0,0 +1,442 @@
1
+ # Plan: consistent, hierarchical action names
2
+
3
+ TODO: all steps of "Order" are done (see DONE at the end). Remaining: the
4
+ aliases in `ACTION_ALIASES` can go after two releases.
5
+
6
+ ## Context
7
+
8
+ Actions are registered with `reg_act(:id, proc, "description", opt)` (`actions.rb:18`)
9
+ and with the `act_list` hash in `key_actions.rb:216`. Modules and minor modes register
10
+ their own actions. There are about 200 ids, chosen ad hoc over time. Users see and
11
+ type them in Search for Actions, in `custom.rb` (`bindkey "C x", :id`), on the key
12
+ bindings page, in the keylog panel, and they're stored in recorded macros.
13
+
14
+ ## Problems (checked 2026-11-20)
15
+
16
+ 1. **No common structure.** Some names start with the thing (`buf_save`,
17
+ `selection_upcase`), others with a verb (`close_current_buffer`, `create_new_file`,
18
+ `copy_cur_line`). Others are named after how they start (`start_buf_manager`,
19
+ `invoke_replace`).
20
+ 2. **Prefixes say where the code lives or which mode it's for, not what it does:**
21
+ `gui_file_finder`, `vim_change_word` (where the binding came from), `e_move_forward_char`,
22
+ `V_join_lines` (a mode letter).
23
+ 3. **Duplicates under different names:**
24
+ - `undo` / `edit_undo` and `redo` / `edit_redo`
25
+ - `jump_last_edit` / `jump_to_last_edit`
26
+ - `move_backward_char` / `e_move_backward_char`
27
+ - `move_next_line` / `forward_line` and `move_prev_line` / `backward_line`
28
+ - `grep_buffer` / `invoke_grep_search`
29
+ 4. **Mixed words for the same idea:**
30
+ - next / forward / forwards, prev / backward / backwards
31
+ - beginning / start, cur / current, buf / buffer
32
+ - find / search / grep / ack
33
+ - show / print / toggle
34
+ 5. **The `:group` option is unused.** About 50 actions set it, but nothing reads
35
+ `opt[:group]`, and the `act_list` loop (`key_actions.rb:326`) drops it.
36
+ 6. **About half the bindings aren't named actions at all.** They are Ruby strings: 134
37
+ of 281 in vimlike, 80 of 159 in vim. The "Descriptive names for key bindings" item
38
+ in `doc/TODO.md` turns them into actions, using the names from this plan.
39
+
40
+ ## Naming scheme: dotted paths
41
+
42
+ Ids are dotted paths, from general to specific: `move.word.next`, `buf.save`,
43
+ `sel.copy`, `case.line.upper`. This is the same idea as the `cnf.tab.width` settings.
44
+
45
+ ### Dots or underscores (investigated)
46
+
47
+ I looked at two forms: underscores (`move_word_next`) and dotted paths
48
+ (`move.word.next`). **I recommend dots:**
49
+
50
+ - **Fewer keypresses.** `.` is one key and `_` is two (shift + `-`). The ids are
51
+ typed in Search for Actions, on the command line and in `custom.rb`.
52
+ - **An exact hierarchy, at any depth.** Splitting on `.` gives the levels, so
53
+ Move ▸ word ▸ next. With underscores, `color_highlight_toggle` can't be split
54
+ correctly without a list of module ids.
55
+ - **Like `cnf`.** A small proxy object `a` gives the same chained syntax as settings:
56
+
57
+ ```ruby
58
+ bindkey "C w", a.move.word.next # a reference; nothing runs
59
+ a.buf.save! # runs the action (like cnf.x.y! reads a setting)
60
+ bindkey "C w", "move.word.next" # the plain string works too
61
+ ```
62
+
63
+ On the command line, `:a.buf.save!` runs an action. Completion after `a.move.`
64
+ can list the children.
65
+ - **Checked in Ruby 3.4:** a proxy based on `BasicObject` with `method_missing` takes
66
+ every path in the tables below. This includes keyword segments (`a.move.line.end`,
67
+ `a.move.word.next`, `a.case.word.upper`) and names that `Object` already defines
68
+ (`a.class`, `a.send`, `a.display`), because `BasicObject` doesn't have those.
69
+
70
+ How dotted ids work in the code:
71
+ - **The registry key is a string** (`"move.word.next"`). `reg_act` and `bindkey` accept
72
+ that string, the `a.…` reference, or (for old ids) a symbol.
73
+ - **String bindings are looked up first.** A string binding is today run as Ruby. The
74
+ dispatcher already tries a registered action first (`key_binding_tree.rb:933`), so
75
+ `"move.word.next"` resolves to the action and any other string still runs as Ruby.
76
+ Some ids are also valid Ruby (`buf.save` calls `Buffer#save`). For those the
77
+ registered action wins, which is what such a binding means anyway.
78
+ - **Typos fail when the binding is made.** `a.move.wrod.next` builds a reference
79
+ without complaint, so `bindkey` checks that the id exists. If it doesn't, it
80
+ reports an error and suggests the closest id.
81
+ - **A path can be both an action and a parent**, for example `buf.save` and
82
+ `buf.save.as`. The reference is only a name, and running needs `!`, so both work.
83
+ - **Use `a` only where it's safe.** A local variable called `a` hides the method `a`,
84
+ and `lib/` assigns `a = …` in 37 places. So `a.` is for `custom.rb` and the command
85
+ line. Code in `lib/` uses the string form.
86
+
87
+ ### Rules
88
+
89
+ - **The first segment is the namespace** (table below). Module and minor-mode
90
+ actions use the module or mode id: `dictation.toggle`, `fexp.copy`,
91
+ `color_highlight.toggle`.
92
+ - **The object comes before the verb or direction:** `move.word.next`, `move.word.prev`,
93
+ `move.word.end`. Related actions sort together, and completion groups them.
94
+ - **Prefer one-word segments.** That keeps ids short and free of `_`. Use `_` only when
95
+ a segment really needs two words (`vim_conflicts`).
96
+ - **Fixed vocabulary:**
97
+ - direction: `next` / `prev`
98
+ - position: `start` / `end`
99
+ - `eol` means "to the end of the line" after an operator
100
+ - on/off: `toggle` as the last segment
101
+ - `buf`, never `buffer`, and `sel` for the selection
102
+ - **Opening a picker or panel takes no verb:** `file.finder`, `buf.switcher`,
103
+ `app.settings`.
104
+ - **No mode letters, scheme names (`vim`), layers (`gui`, `e`) or tool names**
105
+ (`ack`) in ids, unless the tool is what the user chooses.
106
+
107
+ ### Namespaces
108
+
109
+ The namespaces match the categories in `doc/key_bindings_report_plan.md`. A
110
+ binding to a named action gets its category from the namespace, with no manual
111
+ `cat:` tag.
112
+
113
+ | Namespace | Category | Contents |
114
+ |---|---|---|
115
+ | `app` | app | quit, restart, settings, custom.rb, demo |
116
+ | `mode` | insert / visual | mode switches, command line |
117
+ | `move` | motion | cursor motion inside the buffer |
118
+ | `jump` | search | non-local jumps: last edit, easy-jump, file under cursor |
119
+ | `search` | search | search and replace in the buffer, action search |
120
+ | `grep` | grep | grep, searching file contents (built-in) |
121
+ | `ack` | grep | ack, the external search program |
122
+ | `edit` | edit | delete, change, paste, join, indent, comment, increment, autocomplete |
123
+ | `undo` | undo | undo, redo, repeat |
124
+ | `case` | case | case transforms |
125
+ | `sel` | visual | operations on the selection |
126
+ | `buf` | buffer | the current buffer and the buffer list |
127
+ | `file` | file | the file on disk: finder, history, open dialog |
128
+ | `panel` | view | file, function and keylog panels |
129
+ | `view` | view | columns, scrolling, colors |
130
+ | `style` | hpt | hyper plaintext styles |
131
+ | `macro` | macro | macros |
132
+ | `mark` | marks | bookmarks |
133
+ | `lsp` | code | LSP |
134
+ | `term` | code | running lines in a terminal |
135
+ | `help` | help | key bindings, conflicts, messages |
136
+ | `debug` | debug | debug, eval, tests |
137
+ | `custom` | custom | the user's own actions in `custom.rb` |
138
+ | `<module>` | `module:<name>` | module actions |
139
+ | `<minor mode>` | `mode:<id>` | minor-mode actions |
140
+
141
+ ## Renames
142
+
143
+ These are proposals. Rows marked "check" need a look at what the action really does
144
+ before it gets its final name.
145
+
146
+ ### app, mode, help, debug
147
+
148
+ | Old | New |
149
+ |---|---|
150
+ | `quit` | `app.quit` |
151
+ | `restart_editor` | `app.restart` |
152
+ | `show_settings` | `app.settings` |
153
+ | `reload_customrb` / `edit_customrb` | `app.customrb.reload` / `app.customrb.edit` |
154
+ | `install_demo_files` | `app.demo` |
155
+ | `insert_mode` / `start_visual_mode` / `prev_mode` | `mode.insert` / `mode.visual` / `mode.prev` |
156
+ | `start_cmd_line` | `mode.cmdline` |
157
+ | `notepad_escape` | `mode.notepad.escape` (check) |
158
+ | `show_key_bindings` / `show_free_key_bindings` | `help.keys` / `help.keys.free` |
159
+ | `show_vim_binding_conflicts` | `help.vim_conflicts` |
160
+ | `show_message_history` | `help.messages` |
161
+ | `enable_debug` / `disable_debug` | `debug.on` / `debug.off` |
162
+ | `savedebug` | `debug.save` |
163
+ | `eval_buf` | `debug.eval.buf` |
164
+ | `experimental_eval` | `debug.eval.sel` |
165
+ | `command_to_buf` | `debug.command` |
166
+ | `debug_buf_hex` | `debug.buf.sha256` |
167
+ | `print_buffer_access_list` | `debug.buf.access` |
168
+ | `run_tests` | `debug.tests` |
169
+
170
+ ### move, jump
171
+
172
+ | Old | New |
173
+ |---|---|
174
+ | `e_move_forward_char`, `move_forward_char` | `move.char.next` |
175
+ | `e_move_backward_char`, `move_backward_char` | `move.char.prev` |
176
+ | `move_next_line`, `forward_line` | `move.line.next` |
177
+ | `move_prev_line`, `backward_line` | `move.line.prev` |
178
+ | `jump_beginning_of_line` / `jump_end_of_line` | `move.line.start` / `move.line.end` |
179
+ | `jump_next_word_start` / `jump_prev_word_start` | `move.word.next` / `move.word.prev` |
180
+ | `jump_next_word_end` | `move.word.end` |
181
+ | `jump_start_of_buffer` / `jump_end_of_buffer` | `move.buf.start` / `move.buf.end` |
182
+ | `jump_to_random` | `move.random` |
183
+ | `jump_last_edit`, `jump_to_last_edit` | `jump.edit.prev` |
184
+ | `jump_to_next_edit` | `jump.edit.next` |
185
+ | `easy_jump` | `jump.easy` |
186
+ | `open_file_under_cursor` | `jump.file` |
187
+ | `lsp_jump_to_definition` | `lsp.definition` |
188
+
189
+ ### search, grep
190
+
191
+ | Old | New |
192
+ |---|---|
193
+ | `find_in_buffer` / `find_next` | `search.buf` / `search.next` |
194
+ | `gui_search_replace` | `search.replace` |
195
+ | `invoke_replace` | `search.replace.cmd` (check) |
196
+ | `search_actions` | `search.actions` |
197
+ | `grep_buffer`, `invoke_grep_search` | `grep.buf` |
198
+ | `grep_refresh` | `grep.refresh` |
199
+ | `content_search` | `grep.files` (built-in, no external program) |
200
+ | `ack_search` | `ack.search` (own namespace: ack is an external program, to become a module) |
201
+
202
+ ### edit, undo, case, sel
203
+
204
+ | Old | New |
205
+ |---|---|
206
+ | `delete_char_forward`, `vim_delete_char` | `edit.delete.char` |
207
+ | `vim_delete_char_backward` | `edit.delete.char.prev` |
208
+ | `vim_delete_to_eol` | `edit.delete.eol` |
209
+ | `insert_backspace` | `edit.backspace` |
210
+ | `insert_delete` | `edit.delete.char_or_sel` |
211
+ | `vim_change_line` / `vim_change_word` / `vim_change_to_eol` | `edit.change.line` / `edit.change.word` / `edit.change.eol` |
212
+ | `vim_substitute_char` | `edit.change.char` |
213
+ | `vim_open_line_above` / `insert_new_line` | `edit.line.above` / `edit.line.below` (check) |
214
+ | `copy_cur_line` | `edit.line.copy` |
215
+ | `paste_after_cursor` / `paste_before_cursor` | `edit.paste.after` / `edit.paste.before` |
216
+ | `paste_over_after` / `paste_over_before` | `edit.paste.over.after` / `edit.paste.over.before` |
217
+ | `increment_word` | `edit.word.increment` |
218
+ | `auto_indent_buffer` | `edit.indent.buf` |
219
+ | `comment_selection` | `edit.comment` |
220
+ | `autocp_manual_trigger` / `toggle_autocomplete` | `edit.complete` / `edit.complete.toggle` |
221
+ | `undo`, `edit_undo` / `redo`, `edit_redo` | `undo.last` / `undo.redo` |
222
+ | `vim_repeat_last_action` | `undo.repeat` |
223
+ | `word_upcase` / `_downcase` / `_swapcase` | `case.word.upper` / `.lower` / `.swap` |
224
+ | `line_upcase` / `_downcase` / `_swapcase` | `case.line.upper` / `.lower` / `.swap` |
225
+ | `selection_upcase` / `_downcase` / `_swapcase` / `_capitalize` | `case.sel.upper` / `.lower` / `.swap` / `.capitalize` |
226
+ | `vim_toggle_case` | `case.char.toggle` |
227
+ | `select_all` | `sel.all` |
228
+ | `insert_select_up` / `insert_select_down` | `sel.line.prev` / `sel.line.next` |
229
+ | `copy_selection` / `cut_selection` / `vim_change_selection` | `sel.copy` / `sel.cut` / `sel.change` |
230
+ | `selection_reverse` | `sel.reverse` |
231
+ | `selection_remove_indent` / `selection_remove_common_indent` | `sel.unindent` / `sel.unindent.common` |
232
+ | `V_join_lines` / `V_to_latex_itemize` | `sel.join` / `sel.latex_itemize` |
233
+ | converters (`editor.rb:463`, registered by converter id) | `sel.convert.<id>` |
234
+
235
+ ### buf, file
236
+
237
+ | Old | New |
238
+ |---|---|
239
+ | `buf_save` / `buf_save_as` | `buf.save` / `buf.save.as` |
240
+ | `buf_revert` / `buf_backup` / `backup_all_buffers` | `buf.revert` / `buf.backup` / `buf.backup.all` |
241
+ | `buf_new`, `create_new_file` | `buf.new` |
242
+ | `close_current_buffer` / `close_all_buffers` | `buf.close` / `buf.close.all` |
243
+ | `gui_select_buffer` / `start_buf_manager` | `buf.switcher` / `buf.manager` |
244
+ | `history_switch_backwards` / `history_switch_forwards` | `buf.history.prev` / `buf.history.next` |
245
+ | `select_buffer_language` | `buf.language` |
246
+ | `encrypt_file` / `set_unencrypted` | `buf.encrypt` / `buf.encrypt.off` |
247
+ | `git_diff_buffer` / `diff_buffer` | `buf.diff.git` / `buf.diff` (check) |
248
+ | `diff_buffer_jump_to_source` | `diffview.source` |
249
+ | `git_diff_w` | `file.diff.repo` |
250
+ | `open_file_dialog` | `file.open` |
251
+ | `gui_file_finder`, `start_file_selector` | `file.finder` (check whether both are needed) |
252
+ | `gui_file_history_finder` / `fhist_remove_nonexisting` | `file.history` / `file.history.prune` |
253
+ | `delete_current_file` / `set_executable` | `file.delete` / `file.executable` |
254
+ | `put_file_path_to_clipboard` / `put_file_ref_to_clipboard` | `file.path.copy` / `file.ref.copy` |
255
+ | `extract_file_links` | `file.links` |
256
+
257
+ ### panel, view, style, mark, term, lsp, macro
258
+
259
+ | Old | New |
260
+ |---|---|
261
+ | `toggle_file_panel` / `toggle_func_panel` / `toggle_keylog_panel` | `panel.files.toggle` / `panel.funcs.toggle` / `panel.keylog.toggle` |
262
+ | `refresh_func_panel` | `panel.funcs.refresh` |
263
+ | `file_panel_next_file` / `file_panel_prev_file` / `file_panel_easy_jump` | `panel.files.next` / `panel.files.prev` / `panel.files.jump` |
264
+ | `toggle_two_column` / `toggle_active_window` | `view.columns.toggle` / `view.columns.switch` |
265
+ | `center_on_current_line` | `view.center` |
266
+ | `gui_ensure_cursor_visible` / `gui_refresh_cursor` | `view.cursor.show` / `view.cursor.refresh` |
267
+ | `refresh_colors` | `view.colors.reload` |
268
+ | `set_line_style_h1` … `_h4`, `_heading`, `_title`, `_bold`, `_italic` | `style.line.h1` … `style.line.italic` |
269
+ | `clear_line_styles` | `style.line.clear` |
270
+ | `set_style_bold` / `set_style_italic` / `set_style_link` / `clear_formats` | `style.bold` / `style.italic` / `style.link` / `style.clear` |
271
+ | `show_images` | `style.images` |
272
+ | `bookmark_add` / `bookmark_list` | `mark.add` / `mark.list` |
273
+ | `execute_current_line_in_terminal` / `…_autoclose` | `term.line` / `term.line.autoclose` |
274
+ | `lsp_print_functions` / `lsp_restart` / `lsp_debug` | `lsp.functions` / `lsp.restart` / `lsp.debug` |
275
+ | `run_last_macro` | `macro.run.last` |
276
+
277
+ ### Modules and minor modes
278
+
279
+ | Old | New |
280
+ |---|---|
281
+ | `insert_terminal` / `insert_calculator` | `terminal.insert` / `calculator.insert` |
282
+ | `toggle_highlight_colors` | `color_highlight.toggle` |
283
+ | `audio_stop` | `audio.stop` |
284
+ | `dictation_*`, `tts_*`, `ollama_*` | `dictation.*`, `tts.*`, `ollama.*` (first `_` → `.`) |
285
+ | `fexp_*`, `bmgr_*`, `bmark_*` | `fexp.*`, `bmgr.*`, `bmark.*` (first `_` → `.`) |
286
+
287
+ ## Keeping old names working
288
+
289
+ The old ids are used in places this repo doesn't control: users' `custom.rb` and
290
+ saved macros. `macro.rb` records action ids and stores them in `named_macros.json` and
291
+ in the Marshal backups.
292
+
293
+ - `ACTION_ALIASES = { old_symbol => "new.id" }` in `actions.rb`.
294
+ - `ActionList#[]`, `#include?` and `#call` resolve aliases, and so do `bindkey`
295
+ and `unbindkey`.
296
+ - Using an old id from `custom.rb` logs once per id:
297
+ `action :close_current_buffer is now buf.close`.
298
+ - Macros are converted when they're loaded and saved back with the new ids.
299
+ - Search for Actions shows only new ids, but searching for an old id still finds the
300
+ action.
301
+ - The aliases stay for at least two releases. They're listed here and in the release
302
+ notes.
303
+
304
+ ## Using the hierarchy
305
+
306
+ - `Action#path` (the segments) replaces `:group`. Remove `:group` from the
307
+ registrations.
308
+ - **Search for Actions** shows `move.word.next Move to the next word (w)`. A query
309
+ that starts with a namespace and a dot (`move.`) lists only that namespace.
310
+ - **Command line:** `:a.<tab>` completes namespaces, then the segments below them.
311
+ - **Key bindings page:** the category comes from the namespace. Manual `cat:` tags
312
+ are then needed only for Ruby-string bindings.
313
+ - **Menu:** unchanged. `gui_menu.rb` already takes its labels from the action.
314
+
315
+ ## Tests
316
+
317
+ - Every registered id matches `^[a-z][a-z0-9_]*(\.[a-z0-9_]+)+$`. Its first segment is
318
+ a known namespace, or a loaded module or minor-mode id.
319
+ - No two actions have the same proc source and description. This catches duplicates
320
+ like `undo` / `edit_undo`.
321
+ - Every alias points to a registered action.
322
+ - `bindkey` accepts the string, the `a.…` reference and an old symbol (which logs
323
+ once). An unknown id is an error that names the closest id.
324
+ - `a.buf.save!` runs the action.
325
+ - A macro saved with old ids runs and is resaved with new ids.
326
+ - Regenerate `doc/vimlike_vim_conflicts.md`, which `tests/test_vim_conflicts.rb`
327
+ checks.
328
+
329
+ ## Order
330
+
331
+ 1. String ids in the registry, the `a` proxy, aliases, and their tests. No renames
332
+ yet.
333
+ 2. Merge the duplicates (problem 3), keeping the old names as aliases.
334
+ 3. Rename one namespace per commit. Each commit changes the registrations, the
335
+ bindings in all three schemes, `gui_menu.rb`, the tests (`act(:…)`) and
336
+ `custom_example.rb`, and adds the aliases. Run the full suite in the VM after each
337
+ commit.
338
+ 4. `Action#path`, drop `:group`, add namespace filtering and command-line completion.
339
+ 5. Categories on the key bindings page from the namespace (step 2 of
340
+ `doc/key_bindings_report_plan.md`).
341
+ 6. Name the Ruby-string bindings with this scheme, as part of the descriptive-names
342
+ TODO item.
343
+
344
+ ## DONE
345
+
346
+ - **Step 1: string ids, the `a` proxy, aliases** (2026-11-20, `7115ff8`).
347
+ `actions.rb`: `ACTION_ID_RE`, `ACTION_ALIASES`, `ActionRef` (BasicObject;
348
+ `a.x.y` is a reference, `a.x.y!` runs it, an unknown id raises with a "did you
349
+ mean"), and `ActionList#resolve`, which every lookup goes through: a reference
350
+ becomes its string, an old id its new one, with a message once per old id.
351
+ `bindkey` resolves old symbols and rejects an unknown `a.…` reference with the
352
+ closest id (`DidYouMean::SpellChecker`), skipping the binding like an unknown
353
+ mode. Ruby-string bindings are registered with `opt[:code]`, so `exec_action`
354
+ runs a string as an action only when it is a real registered id. Search for
355
+ Actions runs its pick through `exec_action`. Macros are converted on load
356
+ (`Macro#convert_action_aliases`); converted named macros are saved back.
357
+ Tests: `tests/test_action_ids.rb`.
358
+ Left for step 3, when aliases exist in numbers: Search for Actions finding an
359
+ action by its old id.
360
+ - **Step 2: duplicates merged** (2026-11-20, `8da8571`). Merged straight
361
+ into their final ids, so step 3 doesn't rename them again: `undo.last`
362
+ (`undo`, `edit_undo`), `undo.redo` (`redo`, `edit_redo`), `jump.edit.prev`
363
+ (`jump_last_edit`, `jump_to_last_edit`), `move.char.prev`
364
+ (`move_backward_char`, `e_move_backward_char`), `move.char.next`
365
+ (`e_move_forward_char`; there was no `move_forward_char`), `move.line.next` /
366
+ `move.line.prev` (`move_next_line` / `forward_line`, `move_prev_line` /
367
+ `backward_line`), `grep.buf` (`grep_buffer`, `invoke_grep_search`). The old
368
+ ids are aliases. `invoke_grep_search` (menu Actions ▸ Grep) called the
369
+ removed `gui_grep` and failed; it now runs `grep.buf`. Every reference in
370
+ the three schemes, `vim_core.rb`, `gui_menu.rb`, `search_replace.rb`,
371
+ `tests.rb` and the tests uses the new ids.
372
+ - **Step 3: renames, one namespace per commit** (2026-11-20, `30eff08`..`e236da3`,
373
+ and `53fb148` for ack, plus the commit that adds this entry). Every action
374
+ registered by lib/ and modules/ now has a dotted id; the old ids are aliases
375
+ in `ACTION_ALIASES`. Converters register `sel.convert.<id>` (with the
376
+ converter id as alias, in `reg_conv`). `custom_example.rb` uses a new
377
+ `custom` namespace for the user's own actions. New tests: every id is
378
+ `<namespace>.x.y` with a known namespace, module or minor mode, and no two
379
+ actions share code and description (actions from `custom.rb` are skipped).
380
+ Decisions that differ from the tables above:
381
+ - `ack_search` is `ack.search`: ack is an external program and is to become
382
+ its own module. `content_search` (the built-in `FileContentSearch`) is
383
+ `grep.files`.
384
+ - `delete_char_forward` (`edit.delete.char`) and `vim_delete_char`
385
+ (`edit.delete.char.inline`) are not merged: on an empty line vimlike's `x`
386
+ joins lines and vim's does nothing.
387
+ - `start_file_selector` opens the file explorer, so it is `file.explorer`,
388
+ not `file.finder`. `update_file_index` is `file.finder.reindex`.
389
+ - `insert_new_line` (Enter) is `edit.newline`, not `edit.line.below`.
390
+ - Not in the tables: `line_action` → `jump.line`, `page_down`/`page_up` →
391
+ `move.page.next`/`.prev`, browse mode → `mode.browse`/`mode.browse.exit`,
392
+ `delete_line` → `edit.delete.line`, `delete_selection` → `sel.delete`,
393
+ `kbd_dump_state` → `debug.kbd`, macro finder/naming → `macro.find`/`macro.name`.
394
+ - More duplicates merged: `jump_to_start_of_buffer`/`jump_start_of_buffer`
395
+ (`move.buf.start`), the `end` pair, `buf_new`/`create_new_file` (`buf.new`);
396
+ duplicate registrations of `ack_search` and `open_file_dialog` removed.
397
+ - Hook names that equal an action id (`$hook.call(:insert_new_line)`) are
398
+ not action ids and keep their names.
399
+ Found, not fixed: vimlike `C , , f` is bound to `:file_finder`, which has
400
+ never been registered (since 2021); the finder is on `C , f` and `C , z`.
401
+ - **Step 4: using the hierarchy** (2026-11-20, `2882944`).
402
+ `Action#path` gives the segments; the 51 `:group` options are gone (nothing
403
+ read them). `ActionList#complete(prefix)` lists the next level below a
404
+ prefix (`"move."` => `move.buf.`, `move.char.`, ..., `move.random`).
405
+ Search for Actions shows `id description` and the key; a query starting
406
+ with `<namespace>.` searches only that namespace, `move.` alone lists all of
407
+ it, and an old id finds the renamed action (aliases are matched, not
408
+ shown). Command line: tab after `a.` completes one level at a time; with
409
+ several candidates it fills their common prefix and lists them as a message.
410
+ The tab key itself is tested only through `CommandLine#complete_action_id`,
411
+ not with a real key press.
412
+ - **Step 5: categories from the namespace** (2026-11-21, with steps 1-2 of
413
+ `doc/key_bindings_report_plan.md`, see its DONE entry). `ACTION_NS_CATEGORY`
414
+ maps a namespace (or a longer prefix such as `mode.visual`) to a category of
415
+ the key bindings page; only Ruby-string bindings need a `cat:` tag.
416
+ - **Step 6: Ruby-string bindings named** (2026-11-21). The 116 distinct Ruby
417
+ strings bound in vimlike, vim (`vim_core.rb`, `key_bindings_vim.rb`) and
418
+ notepad, plus the 14 text-object templates, are named actions with
419
+ descriptions: 184 binding lines changed. Strings that ran the same code as
420
+ an existing action use it (`buf.move(FORWARD_CHAR)` → `move.char.next`,
421
+ `buf.transform_selection(:upcase)` → `case.sel.upper`, ...); the rest are
422
+ new actions at the end of `key_actions.rb` and, for text objects
423
+ (`obj.<op>.inner|around`), in `bind_vim_text_objects`. New namespaces:
424
+ `kbd` (`kbd.count.digit`) and `obj`. An action bound to a `<char>` key
425
+ gets the typed character as its argument: `KeyBindingTree` runs it as
426
+ `a.<id>!('<char>')`, a string, so macros, `.` repeat and the key log replay
427
+ it as before (`ActionRef` and `ActionList#call` pass arguments on). The
428
+ key log panel coalesces `a.edit.insert.char!(...)` like
429
+ `buf.insert_txt(...)`. Also: the `V d` / `V a d` and Browse `r` / `e`
430
+ inline actions moved to `key_actions.rb` (the vim keymap bound `V d` to
431
+ an id only vimlike registered), the dead `C , , f` binding now runs
432
+ `file.finder`, a duplicate `C , c b` line was removed,
433
+ `debug_print_buffer` no longer requires an unused argument, and empty or
434
+ wrong descriptions were fixed (`edit.delete.word.end`, `view.center`,
435
+ `move.random`).
436
+ Behavior change: vimlike `d O` / `d $` now use `edit.delete.eol`, which
437
+ does nothing on an empty line instead of deleting the previous newline.
438
+ Left: `R <char>` still runs `readchar_new_char(<char>)`, which is not
439
+ defined anywhere (readchar mode looks unused).
440
+ Test: `test_every_binding_has_a_description` in
441
+ `tests/test_key_categories.rb` (every binding of every keymap has a named
442
+ action with a description), plus `<char>` argument and macro replay tests.
data/doc/bundling_plan.md CHANGED
@@ -501,7 +501,8 @@ when the development machine moves to Ubuntu 26.04.
501
501
  `exe/run_tests.rb` load `lib/`/`ext/` next to the script; dead `ext/stridx` load
502
502
  path removed; the desktop launcher runs `$APPIMAGE` when set (quoted per the
503
503
  Desktop Entry spec); gemspec `required_ruby_version >= 3.1` (3.1 untested; the VM
504
- runs 3.2). Tests: `tests/test_bundling.rb`. Code change 5 (the `ruby-lsp` binstub
504
+ runs 3.2). Raised to `>= 3.2` on 2026-11-21 (`scan_indexes` uses
505
+ `MatchData#byteoffset`). Tests: `tests/test_bundling.rb`. Code change 5 (the `ruby-lsp` binstub
505
506
  on PATH) belongs to AppRun, so it comes with `scripts/build_appimage.sh`.
506
507
  - **AppImage build script** (2026-11-19, `bc43676`): `scripts/appimage/build.sh`
507
508
  (host, Docker) runs `scripts/appimage/build_in_container.sh` in the Ubuntu 24.04