vimamsa 0.1.27 → 0.1.29
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.
- checksums.yaml +4 -4
- data/.github/workflows/appimage.yml +17 -10
- data/Dockerfile +2 -2
- data/README.md +162 -90
- data/custom_example.rb +33 -15
- data/doc/TODO.md +334 -110
- data/doc/action_names_plan.md +442 -0
- data/doc/bundling_plan.md +2 -1
- data/doc/delta_syntax_plan.md +293 -0
- data/doc/demo_recording_plan.md +288 -0
- data/doc/design_goals.md +27 -0
- data/doc/intro_page_plan.md +266 -0
- data/doc/key_bindings_report_plan.md +45 -0
- data/doc/line_tree_plan.md +89 -0
- data/doc/missing_vim_bindings.md +34 -44
- data/doc/modules_settings_plan.md +1 -1
- data/doc/registries_plan.md +202 -0
- data/doc/startup_speed_plan.md +97 -0
- data/doc/test_commands.md +232 -0
- data/doc/treap_visualizer.html +585 -0
- data/doc/vim_compatibility_plan.md +186 -31
- data/doc/vimlike_vim_conflicts.md +236 -228
- data/doc/vm_snapshots_plan.md +4 -4
- data/doc/wysiwyg_plan.md +231 -0
- data/docker_cmd.sh +1 -1
- data/exe/run_tests.rb +85 -3
- data/exe/vimamsa +49 -6
- data/help/intro.txt +30 -0
- data/help/vim_intro.txt +31 -0
- data/img/demo.gif +0 -0
- data/img/demo.mp4 +0 -0
- data/lang/hyperplaintext.lang +1 -1
- data/lib/vimamsa/ack.rb +2 -0
- data/lib/vimamsa/actions.rb +381 -36
- data/lib/vimamsa/bookmarks.rb +8 -8
- data/lib/vimamsa/buffer.rb +84 -38
- data/lib/vimamsa/buffer_changetext.rb +58 -36
- data/lib/vimamsa/buffer_list.rb +2 -2
- data/lib/vimamsa/buffer_manager.rb +6 -6
- data/lib/vimamsa/cli_help.rb +75 -0
- data/lib/vimamsa/clipboard.rb +6 -3
- data/lib/vimamsa/conf.rb +9 -0
- data/lib/vimamsa/crash_handler.rb +2 -2
- data/lib/vimamsa/debug.rb +2 -2
- data/lib/vimamsa/demo_player.rb +494 -0
- data/lib/vimamsa/demo_recorder.rb +277 -0
- data/lib/vimamsa/diff_buffer.rb +1 -1
- data/lib/vimamsa/dot_repeat.rb +104 -0
- data/lib/vimamsa/easy_jump.rb +54 -3
- data/lib/vimamsa/editor.rb +136 -65
- data/lib/vimamsa/file_history.rb +1 -1
- data/lib/vimamsa/file_manager.rb +23 -23
- data/lib/vimamsa/form_input.rb +388 -0
- data/lib/vimamsa/gui.rb +89 -13
- data/lib/vimamsa/gui_command_line.rb +44 -5
- data/lib/vimamsa/gui_form_generator.rb +17 -6
- data/lib/vimamsa/gui_func_panel.rb +1 -1
- data/lib/vimamsa/gui_key_hint.rb +165 -0
- data/lib/vimamsa/gui_keylog_panel.rb +164 -2
- data/lib/vimamsa/gui_menu.rb +69 -50
- data/lib/vimamsa/gui_select_window.rb +77 -43
- data/lib/vimamsa/gui_settings.rb +9 -5
- data/lib/vimamsa/gui_sourceview.rb +28 -81
- data/lib/vimamsa/gui_theme.rb +11 -2
- data/lib/vimamsa/hook.rb +2 -0
- data/lib/vimamsa/intro_page.rb +367 -0
- data/lib/vimamsa/key_actions.rb +315 -225
- data/lib/vimamsa/key_binding_tree.rb +228 -61
- data/lib/vimamsa/key_bindings_notepad.rb +18 -16
- data/lib/vimamsa/key_bindings_report.rb +290 -67
- data/lib/vimamsa/key_bindings_vim.rb +43 -297
- data/lib/vimamsa/key_bindings_vim_core.rb +356 -0
- data/lib/vimamsa/key_bindings_vimlike.rb +347 -339
- data/lib/vimamsa/key_names.rb +80 -0
- data/lib/vimamsa/langservp.rb +62 -7
- data/lib/vimamsa/line_tree.rb +367 -0
- data/lib/vimamsa/macro.rb +20 -3
- data/lib/vimamsa/rbvma.rb +15 -0
- data/lib/vimamsa/registers.rb +125 -0
- data/lib/vimamsa/run_ruby.rb +64 -0
- data/lib/vimamsa/search_replace.rb +4 -4
- data/lib/vimamsa/string_util.rb +17 -3
- data/lib/vimamsa/tests.rb +8 -8
- data/lib/vimamsa/text_objects.rb +11 -54
- data/lib/vimamsa/text_transforms.rb +4 -0
- data/lib/vimamsa/tmp_user_dir.rb +39 -0
- data/lib/vimamsa/user_dirs.rb +83 -0
- data/lib/vimamsa/version.rb +1 -1
- data/lib/vimamsa/vim_operators.rb +365 -0
- data/modules/calculator/calculator.rb +5 -5
- data/modules/color_highlight/color_highlight.rb +3 -3
- data/modules/dictation/dictation.rb +32 -32
- data/modules/ollama/ollama.rb +5 -5
- data/modules/terminal/terminal.rb +5 -5
- data/modules/tts/tts.rb +10 -10
- data/run_e2e_vm.sh +3 -3
- data/run_tests_vm.rb +163 -0
- data/scripts/appimage/AppRun +7 -0
- data/scripts/appimage/build_in_container.sh +11 -1
- data/scripts/appimage/smoke_test.sh +1 -1
- data/scripts/demo/demo_easyjump_steps.txt +60 -0
- data/scripts/demo/demo_files_steps.txt +52 -0
- data/scripts/demo/demo_steps.txt +9 -1
- data/scripts/demo/notes.txt +6 -0
- data/scripts/demo/record_demo.rb +60 -81
- data/scripts/demo/report.rb +7 -0
- data/scripts/demo/shapes.rb +1 -0
- data/scripts/demo/square/shapes.rb +29 -0
- data/scripts/demo/square/steps.txt +185 -0
- data/scripts/lib/perf_startup.rb +138 -0
- data/scripts/lib/script_helpers.rb +53 -0
- data/scripts/perf_compare.rb +34 -0
- data/scripts/profile_startup.rb +72 -0
- data/tests/test_action_ids.rb +232 -0
- data/tests/test_auto_format.rb +2 -2
- data/tests/test_autocomplete.rb +1 -1
- data/tests/test_basic_editing.rb +18 -18
- data/tests/test_bookmarks.rb +6 -6
- data/tests/test_bracket_match.rb +3 -0
- data/tests/test_cli_help.rb +64 -0
- data/tests/test_color_highlight.rb +2 -2
- data/tests/test_command_line.rb +1 -1
- data/tests/test_context_menu_file.rb +18 -0
- data/tests/test_copy_paste.rb +33 -33
- data/tests/test_custom_two_phase.rb +1 -1
- data/tests/test_demo_player.rb +355 -0
- data/tests/test_demo_recorder.rb +202 -0
- data/tests/test_dictation.rb +16 -16
- data/tests/test_dot_repeat.rb +88 -0
- data/tests/test_easy_jump.rb +93 -0
- data/tests/test_extract_file_links.rb +3 -3
- data/tests/test_file_panel.rb +2 -2
- data/tests/test_flash.rb +1 -1
- data/tests/test_fold.rb +1 -1
- data/tests/test_form_input.rb +203 -0
- data/tests/test_func_panel.rb +2 -2
- data/tests/test_gtk_sync.rb +7 -7
- data/tests/test_intro_page.rb +437 -0
- data/tests/test_key_categories.rb +163 -0
- data/tests/test_keylog_panel.rb +163 -3
- data/tests/test_line_ends.rb +51 -0
- data/tests/test_line_tree.rb +86 -0
- data/tests/test_lsp_clangd.rb +2 -2
- data/tests/test_lsp_root.rb +43 -0
- data/tests/test_macro.rb +2 -2
- data/tests/test_module_interface.rb +9 -9
- data/tests/test_notepad_bindings.rb +5 -5
- data/tests/test_perf_startup.rb +28 -0
- data/tests/test_random_edit.rb +27 -27
- data/tests/test_registers.rb +131 -0
- data/tests/test_run_ruby.rb +77 -0
- data/tests/test_startup_file.rb +45 -4
- data/tests/test_text_objects.rb +1 -1
- data/tests/test_text_transforms.rb +12 -0
- data/tests/test_tmp_user_dir.rb +79 -0
- data/tests/test_tts.rb +10 -10
- data/tests/test_undo.rb +34 -34
- data/tests/test_user_dirs.rb +122 -0
- data/tests/test_vim_bindings.rb +107 -6
- data/tests/test_vim_conflicts.rb +41 -4
- data/tests/test_vim_operators.rb +116 -0
- data/tests/test_window_layout.rb +83 -0
- data/vimamsa.gemspec +1 -1
- data/vm_guest_run.sh +75 -28
- metadata +60 -4
- data/run_tests.rb +0 -89
- data/run_tests_vm.sh +0 -130
data/lib/vimamsa/key_actions.rb
CHANGED
|
@@ -1,13 +1,5 @@
|
|
|
1
1
|
|
|
2
2
|
module Vimamsa
|
|
3
|
-
def e_move_forward_char
|
|
4
|
-
buf.move(FORWARD_CHAR)
|
|
5
|
-
end
|
|
6
|
-
|
|
7
|
-
def e_move_backward_char
|
|
8
|
-
buf.move(BACKWARD_CHAR)
|
|
9
|
-
end
|
|
10
|
-
|
|
11
3
|
def history_switch_backwards
|
|
12
4
|
bufs.history_switch_backwards
|
|
13
5
|
end
|
|
@@ -21,108 +13,105 @@ def jump_to_next_edit
|
|
|
21
13
|
end
|
|
22
14
|
|
|
23
15
|
|
|
24
|
-
reg_act(
|
|
16
|
+
reg_act("debug.command", proc { command_to_buf }, "Execute command, output to buffer")
|
|
25
17
|
|
|
26
|
-
reg_act(
|
|
27
|
-
reg_act(
|
|
28
|
-
reg_act(
|
|
18
|
+
reg_act("lsp.debug", proc { vma.buf.lsp_get_def }, "LSP get definition")
|
|
19
|
+
reg_act("lsp.definition", proc { vma.buf.lsp_jump_to_def }, "LSP jump to definition")
|
|
20
|
+
reg_act("lsp.restart", proc { require "vimamsa/langservp"; lsp_restart },
|
|
29
21
|
"LSP: restart the language server of the current file (e.g. after adding compile_flags.txt)")
|
|
30
22
|
|
|
31
|
-
reg_act(
|
|
32
|
-
|
|
33
|
-
reg_act(
|
|
34
|
-
reg_act(
|
|
35
|
-
reg_act(
|
|
36
|
-
|
|
37
|
-
reg_act(
|
|
38
|
-
reg_act(
|
|
39
|
-
reg_act(
|
|
40
|
-
reg_act(
|
|
41
|
-
reg_act(
|
|
42
|
-
|
|
43
|
-
reg_act(
|
|
44
|
-
reg_act(
|
|
45
|
-
reg_act(
|
|
46
|
-
|
|
47
|
-
reg_act(
|
|
48
|
-
|
|
49
|
-
reg_act(
|
|
50
|
-
reg_act(
|
|
51
|
-
reg_act(
|
|
52
|
-
|
|
53
|
-
reg_act(
|
|
54
|
-
reg_act(
|
|
55
|
-
reg_act(
|
|
56
|
-
reg_act(
|
|
57
|
-
reg_act(
|
|
58
|
-
reg_act(
|
|
59
|
-
|
|
60
|
-
reg_act(
|
|
61
|
-
reg_act(
|
|
62
|
-
reg_act(
|
|
63
|
-
reg_act(
|
|
64
|
-
reg_act(
|
|
65
|
-
reg_act(
|
|
66
|
-
reg_act(
|
|
67
|
-
reg_act(
|
|
68
|
-
reg_act(
|
|
69
|
-
reg_act(
|
|
70
|
-
reg_act(
|
|
71
|
-
reg_act(
|
|
72
|
-
reg_act(
|
|
73
|
-
reg_act(
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
reg_act(
|
|
77
|
-
reg_act(
|
|
78
|
-
reg_act(
|
|
79
|
-
|
|
80
|
-
reg_act(
|
|
81
|
-
reg_act(
|
|
82
|
-
reg_act(
|
|
83
|
-
reg_act(
|
|
84
|
-
reg_act(
|
|
85
|
-
reg_act(
|
|
86
|
-
reg_act(
|
|
87
|
-
reg_act(
|
|
88
|
-
reg_act(
|
|
89
|
-
reg_act(
|
|
90
|
-
reg_act(
|
|
91
|
-
reg_act(
|
|
92
|
-
reg_act(
|
|
93
|
-
reg_act(
|
|
94
|
-
reg_act(
|
|
95
|
-
reg_act(
|
|
96
|
-
reg_act(
|
|
97
|
-
reg_act(
|
|
98
|
-
reg_act(
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
reg_act(
|
|
102
|
-
reg_act(
|
|
103
|
-
reg_act(
|
|
104
|
-
reg_act(
|
|
105
|
-
reg_act(
|
|
106
|
-
reg_act(
|
|
107
|
-
reg_act(
|
|
108
|
-
reg_act(
|
|
109
|
-
reg_act(
|
|
110
|
-
reg_act(
|
|
111
|
-
reg_act(
|
|
112
|
-
reg_act(
|
|
113
|
-
reg_act(
|
|
114
|
-
reg_act(
|
|
115
|
-
reg_act(
|
|
116
|
-
reg_act
|
|
117
|
-
reg_act
|
|
118
|
-
reg_act(
|
|
119
|
-
reg_act(
|
|
120
|
-
reg_act(
|
|
121
|
-
reg_act(
|
|
122
|
-
|
|
123
|
-
reg_act(:invoke_grep_search, proc { gui_grep }, "Grep current buffer")
|
|
124
|
-
reg_act(:ack_search, proc { gui_ack }, "") #invoke_ack_search
|
|
125
|
-
reg_act(:extract_file_links, proc {
|
|
23
|
+
reg_act("debug.eval.buf", proc { vma.buf.eval_whole_buf }, "Eval whole current buffer as ruby code (DANGEROUS)")
|
|
24
|
+
|
|
25
|
+
reg_act("app.settings", proc { show_settings_dialog }, "Show settings")
|
|
26
|
+
reg_act("view.colors.reload", proc { gui_reload_theme_and_colors }, "Reload theme color palettes + config and refresh the UI (no restart)")
|
|
27
|
+
reg_act("sel.cut", proc { buf.delete(SELECTION) }, "Cut selection to clipboard")
|
|
28
|
+
|
|
29
|
+
reg_act("edit.backspace", proc { buf.selection_active? ? buf.delete(SELECTION) : buf.delete(BACKWARD_CHAR) }, "Delete backwards")
|
|
30
|
+
reg_act("edit.delete.char_or_sel", proc { buf.selection_active? ? buf.delete(SELECTION) : buf.delete(CURRENT_CHAR_FORWARD) }, "Delete forward (selection-aware)")
|
|
31
|
+
reg_act("sel.all", proc { buf.select_all }, "Select all text")
|
|
32
|
+
reg_act("sel.line.prev", proc { insert_select_move(BACKWARD_LINE) }, "Select texte upwards")
|
|
33
|
+
reg_act("sel.line.next", proc { insert_select_move(FORWARD_LINE) }, "Select text downwards")
|
|
34
|
+
|
|
35
|
+
reg_act("sel.copy", proc { buf.copy_active_selection }, "Copy selection to clipboard")
|
|
36
|
+
reg_act("debug.on", proc { cnf.debug = true }, "Enable debug")
|
|
37
|
+
reg_act("debug.off", proc { cnf.debug = false }, "Disable debug")
|
|
38
|
+
|
|
39
|
+
reg_act("debug.eval.sel", proc { bindkey "V , e", "vma.buf.convert_selected_text(:eval)" }, "Enable key binding:\"[VISUAL] , e:\" Eval selected text")
|
|
40
|
+
|
|
41
|
+
reg_act("jump.easy", proc { EasyJump.start }, "Easy jump")
|
|
42
|
+
reg_act("view.cursor.show", proc { vma.gui.view.ensure_cursor_visible }, "Scroll to current cursor position")
|
|
43
|
+
reg_act("view.cursor.refresh", proc { vma.buf.refresh_cursor }, "Refresh cursor")
|
|
44
|
+
|
|
45
|
+
reg_act("debug.save", "savedebug", "Save debug info")
|
|
46
|
+
reg_act("file.open", "open_file_dialog", "Open file")
|
|
47
|
+
reg_act("buf.backup.all", proc { backup_all_buffers }, "Backup all buffers")
|
|
48
|
+
reg_act("move.char.next", proc { buf.move(FORWARD_CHAR) }, "Move forward one character")
|
|
49
|
+
reg_act("move.char.prev", proc { buf.move(BACKWARD_CHAR) }, "Move backward one character")
|
|
50
|
+
reg_act("move.line.next", proc { buf.move(FORWARD_LINE) }, "Move one line forward")
|
|
51
|
+
reg_act("move.line.prev", proc { buf.move(BACKWARD_LINE) }, "Move one line backward")
|
|
52
|
+
# reg_act("buf.history.prev", proc{bufs.history_switch_backwards}, "")
|
|
53
|
+
reg_act("buf.history.prev", proc { bufs.history_switch(-1) }, "Prev buffer")
|
|
54
|
+
reg_act("buf.history.next", proc { bufs.history_switch(+1) }, "Next buffer")
|
|
55
|
+
reg_act("debug.buf.access", proc { bufs.print_by_access_time }, "Print buffers by access time")
|
|
56
|
+
reg_act("view.center", "center_on_current_line", "Center the view on the cursor line")
|
|
57
|
+
reg_act("macro.run.last", proc { vma.macro.run_last_macro }, "Run last recorded or executed macro")
|
|
58
|
+
reg_act("jump.edit.next", "jump_to_next_edit", "Jump to next edit pos")
|
|
59
|
+
reg_act("jump.edit.prev", proc { buf.jump_to_last_edit }, "Jump to the last edit location")
|
|
60
|
+
reg_act("move.random", proc { buf.jump_to_random_pos }, "Jump to a random position")
|
|
61
|
+
reg_act("edit.newline", proc { buf.insert_new_line() }, "Insert new line")
|
|
62
|
+
reg_act("help.keys", proc { show_key_bindings }, "Show key bindings")
|
|
63
|
+
reg_act("help.keys.free", proc { show_free_key_bindings }, "Show available (unbound) key binding slots")
|
|
64
|
+
reg_act("help.vim_conflicts", proc { show_vim_binding_conflicts }, "Show which vim key bindings conflict with the vimlike keymap")
|
|
65
|
+
reg_act("file.path.copy", proc { buf.put_file_path_to_clipboard }, "Put file path of current file to clipboard")
|
|
66
|
+
reg_act("file.ref.copy", proc { buf.put_file_ref_to_clipboard }, "Put file ref of current file to clipboard")
|
|
67
|
+
|
|
68
|
+
# reg_act("buf.encrypt", proc{buf.set_encrypted},"Set current file to encrypt on save")
|
|
69
|
+
reg_act("buf.encrypt", proc { encrypt_cur_buffer }, "Set current file to encrypt on save")
|
|
70
|
+
reg_act("buf.encrypt.off", proc { buf.set_unencrypted }, "Set current file to save unencrypted")
|
|
71
|
+
reg_act("file.executable", proc { buf.set_executable }, "Set current file permissions to executable")
|
|
72
|
+
# reg_act("buf.close.all", proc { bufs.close_all_buffers() }, "Close all buffers")
|
|
73
|
+
reg_act("buf.close", proc { bufs.close_current_buffer(true) }, "Close current buffer")
|
|
74
|
+
reg_act("panel.files.toggle", proc { vma.gui.toggle_file_panel }, "Toggle file panel")
|
|
75
|
+
reg_act("panel.files.prev", proc { vma.gui.file_panel_select_adjacent(-1) }, "Switch to previous file in file panel order")
|
|
76
|
+
reg_act("panel.files.next", proc { vma.gui.file_panel_select_adjacent(1) }, "Switch to next file in file panel order")
|
|
77
|
+
reg_act("panel.files.jump", proc { vma.gui.file_panel_easy_jump }, "Easy jump: pick a file in the file panel by label")
|
|
78
|
+
reg_act("help.messages", proc { vma.gui.show_message_history }, "Show message history")
|
|
79
|
+
reg_act("mode.cmdline", proc { vma.gui.cmd_line.start }, "Open command line (:)")
|
|
80
|
+
reg_act("panel.funcs.toggle", proc { vma.gui.toggle_func_panel }, "Toggle LSP function panel")
|
|
81
|
+
reg_act("panel.funcs.refresh", proc { vma.gui.func_panel_refresh }, "Refresh LSP function panel")
|
|
82
|
+
reg_act("panel.keylog.toggle", proc { vma.gui.toggle_keylog_panel }, "Toggle key log panel")
|
|
83
|
+
reg_act("file.diff.repo", proc { git_diff_w }, "Show git diff -w for whole repository")
|
|
84
|
+
reg_act("lsp.functions", proc { lsp_print_functions }, "LSP print functions in current file")
|
|
85
|
+
reg_act("edit.comment", proc { buf.comment_selection }, "Comment selection")
|
|
86
|
+
reg_act("edit.delete.char", proc { buf.delete(CURRENT_CHAR_FORWARD) }, "Delete char forward")
|
|
87
|
+
reg_act("file.finder", proc { vma.FileFinder.start_gui }, "Fuzzy file finder")
|
|
88
|
+
reg_act("file.history", proc { vma.FileHistory.start_gui }, "Fuzzy file history finder")
|
|
89
|
+
reg_act("search.replace", proc { gui_search_replace }, "Search and replace")
|
|
90
|
+
reg_act("buf.language", proc { gui_select_buffer_language }, "Select syntax highlighting language for current buffer")
|
|
91
|
+
reg_act("search.next", proc { $search.jump_to_next() }, "Find next")
|
|
92
|
+
|
|
93
|
+
reg_act("style.bold", proc { buf.style_transform(:bold) }, "Set text weight to bold")
|
|
94
|
+
reg_act("style.link", proc { buf.style_transform(:link) }, "Set text as link")
|
|
95
|
+
reg_act("style.italic", proc { buf.style_transform(:italic) }, "Set text style to italic")
|
|
96
|
+
reg_act("sel.join", proc { vma.buf.convert_selected_text(:joinlines) }, "Join lines")
|
|
97
|
+
reg_act("sel.latex_itemize", proc { vma.buf.convert_selected_text(:latex_itemize) }, "Convert selection to LaTeX itemize list")
|
|
98
|
+
reg_act("style.clear", proc { buf.style_transform(:clear) }, "Clear style formats")
|
|
99
|
+
reg_act("style.line.heading", proc { buf.set_line_style(:heading) }, "Set style of current line as heading")
|
|
100
|
+
reg_act("style.line.h1", proc { buf.set_line_style(:h1) }, "Set cur line as Heading 1")
|
|
101
|
+
reg_act("style.line.h2", proc { buf.set_line_style(:h2) }, "Set cur line as Heading 1")
|
|
102
|
+
reg_act("style.line.h3", proc { buf.set_line_style(:h3) }, "Set cur line as Heading 1")
|
|
103
|
+
reg_act("style.line.h4", proc { buf.set_line_style(:h4) }, "Set cur line as Heading 1")
|
|
104
|
+
reg_act("style.line.bold", proc { buf.set_line_style(:bold) }, "Set style of current line as bold")
|
|
105
|
+
reg_act("style.line.title", proc { buf.set_line_style(:title) }, "Set style of current line as title")
|
|
106
|
+
reg_act("style.line.italic", proc { buf.set_line_style(:italic) }, "Set style of current line as italic")
|
|
107
|
+
reg_act("style.line.clear", proc { buf.set_line_style(:clear) }, "Clear styles of current line")
|
|
108
|
+
reg_act("buf.switcher", proc { vma.kbd.set_mode("S"); gui_select_buffer }, "Select buffer")
|
|
109
|
+
reg_act "mode.minibuffer.end", proc { minibuffer_end }
|
|
110
|
+
reg_act("search.replace.cmd", "invoke_replace", "Invoke replace")
|
|
111
|
+
reg_act("buf.diff", "diff_buffer", "")
|
|
112
|
+
reg_act("buf.diff.git", proc { git_diff_buffer }, "Show git diff of current file")
|
|
113
|
+
reg_act("diffview.source", proc { diff_buffer_jump_to_source }, "Jump to corresponding line in source from diff buffer")
|
|
114
|
+
reg_act("file.links", proc {
|
|
126
115
|
links = buf.file_links
|
|
127
116
|
if links.empty?
|
|
128
117
|
message("No links to existing files")
|
|
@@ -132,7 +121,7 @@ reg_act(:extract_file_links, proc {
|
|
|
132
121
|
message("#{links.size} file link(s)")
|
|
133
122
|
end
|
|
134
123
|
}, "Extract links to existing files from current file into a new buffer")
|
|
135
|
-
reg_act(
|
|
124
|
+
reg_act("jump.file", proc {
|
|
136
125
|
# Like vim gf, and the "Open file" items of the right-click menu
|
|
137
126
|
fn = buf.file_path_at(buf.pos)
|
|
138
127
|
if fn.nil?
|
|
@@ -142,183 +131,181 @@ reg_act(:open_file_under_cursor, proc {
|
|
|
142
131
|
else
|
|
143
132
|
open_with_default_program(fn)
|
|
144
133
|
end
|
|
145
|
-
}, "Open file whose path is under the cursor"
|
|
146
|
-
reg_act
|
|
147
|
-
reg_act
|
|
148
|
-
reg_act
|
|
149
|
-
reg_act
|
|
150
|
-
|
|
151
|
-
reg_act(
|
|
152
|
-
|
|
153
|
-
reg_act(
|
|
154
|
-
reg_act(
|
|
155
|
-
reg_act(
|
|
156
|
-
reg_act(
|
|
157
|
-
reg_act(
|
|
158
|
-
reg_act(
|
|
159
|
-
reg_act(
|
|
160
|
-
reg_act(
|
|
161
|
-
reg_act(
|
|
162
|
-
reg_act(
|
|
163
|
-
reg_act(
|
|
164
|
-
reg_act(
|
|
165
|
-
reg_act(
|
|
166
|
-
reg_act(
|
|
167
|
-
reg_act(
|
|
168
|
-
reg_act(
|
|
169
|
-
reg_act(
|
|
170
|
-
reg_act(
|
|
171
|
-
reg_act(
|
|
172
|
-
reg_act(
|
|
173
|
-
reg_act(
|
|
174
|
-
reg_act(
|
|
175
|
-
reg_act(
|
|
176
|
-
|
|
177
|
-
reg_act(
|
|
134
|
+
}, "Open file whose path is under the cursor")
|
|
135
|
+
reg_act "file.finder.reindex", proc { FileFinder.update_index }, "Update file index"
|
|
136
|
+
reg_act "edit.delete.word.end", proc { buf.delete2(:to_word_end) }, "Delete to the end of the word"
|
|
137
|
+
reg_act "edit.delete.word.next", proc { buf.delete2(:to_next_word) }, "Delete to start of next word"
|
|
138
|
+
reg_act "edit.delete.line.start", proc { buf.delete2(:to_line_start) }, "Delete to line start"
|
|
139
|
+
|
|
140
|
+
reg_act("ack.search", proc { gui_ack }, "Search file contents with ack (external program)")
|
|
141
|
+
|
|
142
|
+
reg_act("edit.line.copy", proc { buf.copy_line }, "Copy the current line")
|
|
143
|
+
reg_act("edit.paste.before", proc { buf.paste(BEFORE) }, "Paste text before the cursor")
|
|
144
|
+
reg_act("edit.paste.after", proc { buf.paste(AFTER) }, "Paste text after the cursor")
|
|
145
|
+
reg_act("edit.paste.over.after", proc { buf.paste_over(AFTER) }, "Paste over selection or after cursor")
|
|
146
|
+
reg_act("edit.paste.over.before", proc { buf.paste_over(BEFORE) }, "Paste over selection or before cursor")
|
|
147
|
+
reg_act("undo.redo", proc { buf.redo() }, "Redo the last undone action")
|
|
148
|
+
reg_act("undo.last", proc { buf.undo() }, "Undo the last action")
|
|
149
|
+
reg_act("move.line.end", proc { buf.jump(END_OF_LINE) }, "Move to the end of the current line")
|
|
150
|
+
reg_act("move.buf.end", proc { buf.jump(END_OF_BUFFER) }, "Move to the end of the buffer")
|
|
151
|
+
reg_act("move.buf.start", proc { buf.jump(START_OF_BUFFER) }, "Move to the start of the buffer")
|
|
152
|
+
reg_act("move.line.start", proc { buf.jump(BEGINNING_OF_LINE) }, "Move to the beginning of the current line")
|
|
153
|
+
reg_act("move.word.end", proc { buf.jump_word(FORWARD, WORD_END) }, "Jump to the end of the next word")
|
|
154
|
+
reg_act("move.word.prev", proc { buf.jump_word(BACKWARD, WORD_START) }, "Jump to the start of the previous word")
|
|
155
|
+
reg_act("move.word.next", proc { buf.jump_word(FORWARD, WORD_START) }, "Jump to the start of the next word")
|
|
156
|
+
reg_act("mode.insert", proc { vma.kbd.set_mode(:insert) }, "Switch to INSERT mode")
|
|
157
|
+
reg_act("mode.prev", proc { vma.kbd.to_previous_mode }, "Return to the previous mode")
|
|
158
|
+
reg_act("mode.visual", proc { buf.start_selection; vma.kbd.set_mode(:visual) }, "Enter VISUAL mode (for selections)")
|
|
159
|
+
reg_act("app.demo", proc { install_demo_files }, "Install and show Demo")
|
|
160
|
+
reg_act("help.demo", proc { DemoPlayer.toggle(:basic) }, "Play the basic editing demo (again: stop it)")
|
|
161
|
+
reg_act("help.demo.easyjump", proc { DemoPlayer.toggle(:easyjump) }, "Play the easy jump demo (again: stop it)")
|
|
162
|
+
reg_act("help.demo.files", proc { DemoPlayer.toggle(:files) }, "Play the file switching demo (again: stop it)")
|
|
163
|
+
reg_act("help.demo.pause", proc { DemoPlayer.pause_toggle }, "Pause or continue the demo")
|
|
164
|
+
reg_act("help.demo.faster", proc { DemoPlayer.faster }, "Play the demo faster")
|
|
165
|
+
reg_act("help.demo.slower", proc { DemoPlayer.slower }, "Play the demo slower")
|
|
166
|
+
reg_act("help.demo.stop", proc { DemoPlayer.stop }, "Stop the demo")
|
|
167
|
+
reg_act("help.demo.record", proc { DemoRecorder.toggle }, "Record a demo (again: stop and save it)")
|
|
168
|
+
reg_act("help.demo.recorded.last", proc {
|
|
169
|
+
k = DemoRecorder.last_saved || DemoPlayer.user_demos.keys.last
|
|
170
|
+
k ? DemoPlayer.toggle(k) : message("No recorded demos (Help ▸ Demos ▸ Record demo)")
|
|
171
|
+
}, "Play the demo recorded last")
|
|
172
|
+
reg_act("help.intro", proc { show_help_page("intro") }, "Show the introduction page")
|
|
173
|
+
reg_act("help.vim_intro", proc { show_help_page("vim_intro") }, "Show the main differences from Vim")
|
|
174
|
+
reg_act("help.intro.startup.toggle", proc { toggle_intro_on_startup }, "Show the introduction page at start, or not")
|
|
175
|
+
reg_act("app.customrb.reload", proc { reload_customrb }, "Reload custom.rb")
|
|
176
|
+
|
|
177
|
+
reg_act("edit.complete.toggle", proc {
|
|
178
178
|
cnf.autocomplete.enabled = !(cnf.autocomplete.enabled? != false)
|
|
179
179
|
vma.buf&.view&.hide_completions unless cnf.autocomplete.enabled?
|
|
180
180
|
message("Autocomplete: #{cnf.autocomplete.enabled? ? "ON" : "OFF"}")
|
|
181
181
|
}, "Toggle autocomplete on/off")
|
|
182
182
|
|
|
183
|
-
reg_act(
|
|
183
|
+
reg_act("app.restart", proc { restart_editor }, "Restart: quit, reload config and reopen files")
|
|
184
184
|
|
|
185
|
-
reg_act
|
|
185
|
+
reg_act "mode.browse", proc {
|
|
186
186
|
vma.kbd.set_mode(:browse)
|
|
187
187
|
bufs.reset_navigation
|
|
188
188
|
}, "Start browse mode"
|
|
189
|
-
reg_act
|
|
190
|
-
reg_act
|
|
189
|
+
reg_act "debug.kbd", proc { vma.kbd.dump_state; pp ["vma.buf.mode_stack", vma.buf.mode_stack] }, "Dump keyboard tree state"
|
|
190
|
+
reg_act "mode.passthrough.toggle", proc {
|
|
191
191
|
vma.gui.instance_variable_set(:@kbd_passthrough, !vma.gui.instance_variable_get(:@kbd_passthrough))
|
|
192
192
|
state = vma.gui.instance_variable_get(:@kbd_passthrough) ? "ON" : "OFF"
|
|
193
193
|
message("Keyboard passthrough: #{state}")
|
|
194
194
|
}, "Toggle keyboard event passthrough (allow other widgets to receive key events)"
|
|
195
195
|
|
|
196
|
-
reg_act
|
|
196
|
+
reg_act "mode.browse.exit", proc {
|
|
197
197
|
bufs.add_current_buf_to_history
|
|
198
198
|
# Load previously saved buffer specific mode stack
|
|
199
199
|
buf.restore_kbd_mode
|
|
200
200
|
}, "Exit browse mode"
|
|
201
201
|
|
|
202
|
-
# reg_act
|
|
203
|
-
reg_act
|
|
202
|
+
# reg_act "move.page.next", proc { page_down }, "Page down"
|
|
203
|
+
reg_act "move.page.next", proc { vma.gui.page_down }, "Page down"
|
|
204
204
|
|
|
205
|
-
reg_act
|
|
206
|
-
reg_act
|
|
207
|
-
reg_act
|
|
208
|
-
reg_act(
|
|
209
|
-
reg_act(
|
|
210
|
-
reg_act(
|
|
211
|
-
reg_act(
|
|
212
|
-
reg_act(:delete_current_file, proc { bufs.delete_current_buffer() }, "Delete current file")
|
|
205
|
+
reg_act "move.page.prev", proc { vma.gui.page_up }, "Page up"
|
|
206
|
+
reg_act("edit.indent.buf", proc { buf.auto_format }, "Auto format buffer")
|
|
207
|
+
reg_act("term.line", proc { buf.execute_current_line_in_terminal }, "Execute current line in terminal")
|
|
208
|
+
reg_act("buf.run.ruby", proc { run_buffer_as_ruby }, "Run the file as Ruby (saved first); its output in a new buffer")
|
|
209
|
+
reg_act("term.line.autoclose", proc { buf.execute_current_line_in_terminal(true) }, "Execute current line in terminal. Close after execution.")
|
|
210
|
+
reg_act("style.images", proc { hpt_scan_images() }, "Show images inserted with ⟦img:file.png⟧ syntax")
|
|
211
|
+
reg_act("file.delete", proc { bufs.delete_current_buffer() }, "Delete current file")
|
|
213
212
|
|
|
214
|
-
reg_act(
|
|
213
|
+
reg_act("audio.stop", proc { Audio.stop }, "Stop audio playback")
|
|
215
214
|
|
|
216
215
|
act_list = {
|
|
217
216
|
# File handling
|
|
218
|
-
|
|
219
|
-
:desc => "Save buffer"
|
|
220
|
-
|
|
221
|
-
:buf_save_as => { :proc => proc { buf.save_as },
|
|
222
|
-
:desc => "Save file as", :group => :file },
|
|
223
|
-
:buf_new => { :proc => proc { create_new_file() }, :desc => "Create a new file", :group => :file },
|
|
224
|
-
:buf_revert => { :proc => proc { buf.revert },
|
|
225
|
-
:desc => "Reload file from disk", :group => :file },
|
|
226
|
-
:buf_backup => { :proc => proc { buf.backup() }, :desc => "Backup current file", :group => :file },
|
|
217
|
+
"buf.save" => { :proc => proc { buf.save },
|
|
218
|
+
:desc => "Save buffer" },
|
|
227
219
|
|
|
228
|
-
|
|
229
|
-
|
|
220
|
+
"buf.save.as" => { :proc => proc { buf.save_as },
|
|
221
|
+
:desc => "Save file as" },
|
|
222
|
+
"buf.new" => { :proc => proc { create_new_file() }, :desc => "Create a new file" },
|
|
223
|
+
"buf.revert" => { :proc => proc { buf.revert },
|
|
224
|
+
:desc => "Reload file from disk" },
|
|
225
|
+
"buf.backup" => { :proc => proc { buf.backup() }, :desc => "Backup current file" },
|
|
230
226
|
|
|
231
|
-
|
|
232
|
-
|
|
227
|
+
"search.buf" => { :proc => proc { invoke_search },
|
|
228
|
+
:desc => "Find" },
|
|
233
229
|
|
|
234
|
-
|
|
235
|
-
|
|
230
|
+
"case.sel.upper" => { :proc => proc { buf.transform_selection(:upcase) },
|
|
231
|
+
:desc => "Transform text: upcase" },
|
|
236
232
|
|
|
237
|
-
|
|
238
|
-
|
|
233
|
+
"case.sel.lower" => { :proc => proc { buf.transform_selection(:downcase) },
|
|
234
|
+
:desc => "Transform text: downcase" },
|
|
239
235
|
|
|
240
|
-
|
|
241
|
-
|
|
236
|
+
"case.sel.capitalize" => { :proc => proc { buf.transform_selection(:capitalize) },
|
|
237
|
+
:desc => "Transform text: capitalize" },
|
|
242
238
|
|
|
243
|
-
|
|
244
|
-
|
|
239
|
+
"case.sel.swap" => { :proc => proc { buf.transform_selection(:swapcase) },
|
|
240
|
+
:desc => "Transform text: swapcase" },
|
|
245
241
|
|
|
246
|
-
|
|
247
|
-
|
|
242
|
+
"sel.reverse" => { :proc => proc { buf.transform_selection(:reverse) },
|
|
243
|
+
:desc => "Transform text: reverse" },
|
|
248
244
|
|
|
249
|
-
|
|
250
|
-
|
|
245
|
+
"sel.unindent" => { :proc => proc { buf.remove_indent_selection },
|
|
246
|
+
:desc => "Remove indentation from selected lines (or current line)" },
|
|
251
247
|
|
|
252
|
-
|
|
253
|
-
|
|
248
|
+
"sel.unindent.common" => { :proc => proc { buf.remove_common_indent_selection },
|
|
249
|
+
:desc => "Remove indentation common to all selected lines (keeps relative indent)" },
|
|
254
250
|
|
|
255
|
-
|
|
256
|
-
|
|
251
|
+
"case.word.upper" => { :proc => proc { buf.transform_range(:to_next_word, :upcase) },
|
|
252
|
+
:desc => "Upcase to start of next word (vim gUw)" },
|
|
257
253
|
|
|
258
|
-
|
|
259
|
-
|
|
254
|
+
"case.word.lower" => { :proc => proc { buf.transform_range(:to_next_word, :downcase) },
|
|
255
|
+
:desc => "Downcase to start of next word (vim guw)" },
|
|
260
256
|
|
|
261
|
-
|
|
262
|
-
:desc => "
|
|
257
|
+
"case.word.swap" => { :proc => proc { buf.transform_range(:to_next_word, :swapcase) },
|
|
258
|
+
:desc => "Swap case to start of next word (vim g~w)" },
|
|
263
259
|
|
|
264
|
-
|
|
265
|
-
|
|
260
|
+
"case.line.upper" => { :proc => proc { buf.transform_range(:line, :upcase) },
|
|
261
|
+
:desc => "Upcase current line (vim gUU)" },
|
|
266
262
|
|
|
267
|
-
|
|
268
|
-
|
|
263
|
+
"case.line.lower" => { :proc => proc { buf.transform_range(:line, :downcase) },
|
|
264
|
+
:desc => "Downcase current line (vim guu)" },
|
|
269
265
|
|
|
270
|
-
|
|
271
|
-
:desc => "
|
|
266
|
+
"case.line.swap" => { :proc => proc { buf.transform_range(:line, :swapcase) },
|
|
267
|
+
:desc => "Swap case of current line (vim g~~)" },
|
|
272
268
|
|
|
273
|
-
|
|
274
|
-
:desc => "Swap case of current line (vim g~~)", :group => :edit },
|
|
275
|
-
|
|
276
|
-
:vim_toggle_case => { :proc => proc {
|
|
269
|
+
"case.char.toggle" => { :proc => proc {
|
|
277
270
|
b = buf
|
|
278
271
|
c = b.current_char
|
|
279
272
|
if !c.nil? and c != "\n"
|
|
280
273
|
b.replace_with_char(c.swapcase) # does not advance the cursor
|
|
281
274
|
b.move(FORWARD_CHAR) # vim ~ advances, even on non-letters
|
|
282
275
|
end
|
|
283
|
-
}, :desc => "Toggle case of char and advance (vim ~)"
|
|
284
|
-
|
|
285
|
-
:forward_line => { :proc => proc { buf.move(FORWARD_LINE) },
|
|
286
|
-
:desc => "Move one line forward", :group => [:move, :basic] },
|
|
276
|
+
}, :desc => "Toggle case of char and advance (vim ~)" },
|
|
287
277
|
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
:increment_word => { :proc => proc { buf.increment_current_word },
|
|
292
|
-
:desc => "Increment word", :group => [:edit, :extra] },
|
|
278
|
+
"edit.word.increment" => { :proc => proc { buf.increment_current_word },
|
|
279
|
+
:desc => "Increment word" },
|
|
293
280
|
|
|
294
281
|
# { :proc => proc { },
|
|
295
|
-
# :desc => ""
|
|
282
|
+
# :desc => "" },
|
|
296
283
|
|
|
297
|
-
|
|
298
|
-
:desc => "Search actions"
|
|
284
|
+
"search.actions" => { :proc => proc { vma.actions.gui_search },
|
|
285
|
+
:desc => "Search actions" },
|
|
299
286
|
|
|
300
|
-
|
|
301
|
-
:desc => "Customize (edit custom.rb)"
|
|
287
|
+
"app.customrb.edit" => { :proc => proc { jump_to_file(get_dot_path("custom.rb")) },
|
|
288
|
+
:desc => "Customize (edit custom.rb)" },
|
|
302
289
|
|
|
303
|
-
|
|
304
|
-
:desc => "Switch active column in two column mode"
|
|
290
|
+
"view.columns.switch" => { :proc => proc { vma.gui.toggle_active_window },
|
|
291
|
+
:desc => "Switch active column in two column mode" },
|
|
305
292
|
|
|
306
|
-
|
|
307
|
-
:desc => "Toggle two column mode"
|
|
293
|
+
"view.columns.toggle" => { :proc => proc { vma.gui.toggle_two_column },
|
|
294
|
+
:desc => "Toggle two column mode" },
|
|
308
295
|
|
|
309
|
-
|
|
310
|
-
:desc => "Search content of files"
|
|
296
|
+
"grep.files" => { :proc => proc { FileContentSearch.start_gui },
|
|
297
|
+
:desc => "Search content of files" },
|
|
311
298
|
|
|
312
|
-
|
|
313
|
-
:desc => "Quit"
|
|
299
|
+
"app.quit" => { :proc => proc { _quit },
|
|
300
|
+
:desc => "Quit" },
|
|
314
301
|
|
|
315
|
-
|
|
302
|
+
"debug.tests" => { :proc => proc { run_tests },
|
|
316
303
|
:desc => "Run tests" },
|
|
317
304
|
|
|
318
|
-
|
|
305
|
+
"debug.buf.sha256" => { :proc => proc { puts "SHA256: " + (Digest::SHA2.hexdigest vma.buf.to_s) },
|
|
319
306
|
:desc => "Output SHA256 hex digest of curent buffer" },
|
|
320
307
|
|
|
321
|
-
|
|
308
|
+
"edit.complete" => { :proc => proc { vma.buf.view.autocp_manual_trigger },
|
|
322
309
|
:desc => "Trigger autocomplete" },
|
|
323
310
|
|
|
324
311
|
}
|
|
@@ -327,6 +314,109 @@ for k, v in act_list
|
|
|
327
314
|
reg_act(k, v[:proc], v[:desc])
|
|
328
315
|
end
|
|
329
316
|
|
|
317
|
+
# ── Actions that were Ruby-code bindings (doc/action_names_plan.md step 6) ──
|
|
318
|
+
# An action bound to a "<char>" key gets the typed character as its argument
|
|
319
|
+
# (KeyBindingTree runs it as a.<id>!('<char>')).
|
|
320
|
+
|
|
321
|
+
reg_act("move.line.goto", proc { buf.jump_to_line() }, "Go to line <count>")
|
|
322
|
+
reg_act("move.line.first_char", proc { buf.jump(FIRST_NON_WHITESPACE) }, "Move to the first non-blank character of the line")
|
|
323
|
+
reg_act("move.page.next.quarter", proc { vma.gui.page_down(multip: 0.25) }, "Scroll down a quarter page")
|
|
324
|
+
reg_act("move.page.prev.quarter", proc { vma.gui.page_up(multip: 0.25) }, "Scroll up a quarter page")
|
|
325
|
+
reg_act("move.page.next.cursor", proc { buf.move(:forward_page) }, "Move the cursor to the bottom of the view and scroll")
|
|
326
|
+
reg_act("move.page.prev.cursor", proc { buf.move(:backward_page) }, "Move the cursor to the top of the view and scroll")
|
|
327
|
+
# Insert mode: a plain arrow key ends a shift-arrow selection
|
|
328
|
+
reg_act("move.char.next.unselect", proc { insert_move(FORWARD_CHAR) }, "Move forward one character, ending the selection")
|
|
329
|
+
reg_act("move.char.prev.unselect", proc { insert_move(BACKWARD_CHAR) }, "Move backward one character, ending the selection")
|
|
330
|
+
reg_act("move.line.next.unselect", proc { insert_move(FORWARD_LINE) }, "Move one line forward, ending the selection")
|
|
331
|
+
reg_act("move.line.prev.unselect", proc { insert_move(BACKWARD_LINE) }, "Move one line backward, ending the selection")
|
|
332
|
+
reg_act("move.page.next.unselect", proc { insert_move(:pagedown) }, "Page down, ending the selection")
|
|
333
|
+
reg_act("move.page.prev.unselect", proc { insert_move(:pageup) }, "Page up, ending the selection")
|
|
334
|
+
reg_act("move.line.start.unselect", proc { buf.end_selection; buf.jump(BEGINNING_OF_LINE) }, "Move to the beginning of the line, ending the selection")
|
|
335
|
+
reg_act("move.line.end.unselect", proc { buf.end_selection; buf.jump(END_OF_LINE) }, "Move to the end of the line, ending the selection")
|
|
336
|
+
|
|
337
|
+
reg_act("kbd.count.digit", proc { |c| vma.kbd.set_next_command_count(c) }, "Type a digit of the repeat count")
|
|
338
|
+
|
|
339
|
+
reg_act("jump.char.next", proc { |c| buf.jump_to_next_instance_of_char(c) }, "Jump to the next <char>")
|
|
340
|
+
reg_act("jump.char.prev", proc { |c| buf.jump_to_next_instance_of_char(c, BACKWARD) }, "Jump to the previous <char>")
|
|
341
|
+
reg_act("jump.space.next", proc { buf.jump_to_next_instance_of_char(" ") }, "Jump to the next space")
|
|
342
|
+
reg_act("jump.space.prev", proc { buf.jump_to_next_instance_of_char(" ", BACKWARD) }, "Jump to the previous space")
|
|
343
|
+
reg_act("jump.char.repeat", proc { repeat_last_find }, "Repeat the last character jump (f, F)")
|
|
344
|
+
reg_act("search.prev", proc { $search.jump_to_previous() }, "Find previous")
|
|
345
|
+
reg_act("search.word.next", proc { buf.jump_to_next_instance_of_word }, "Find the next occurrence of the word under the cursor")
|
|
346
|
+
|
|
347
|
+
reg_act("mode.insert.after", proc { buf.move(FORWARD_CHAR); vma.kbd.set_mode(:insert) }, "Switch to INSERT mode after the cursor")
|
|
348
|
+
reg_act("mode.insert.line.start", proc { buf.jump(FIRST_NON_WHITESPACE); vma.kbd.set_mode(:insert) }, "Switch to INSERT mode at the first non-blank character of the line")
|
|
349
|
+
reg_act("mode.insert.line.end", proc { buf.jump(END_OF_LINE); vma.kbd.set_mode(:insert) }, "Switch to INSERT mode at the end of the line")
|
|
350
|
+
reg_act("mode.insert.line.below", proc { buf.jump(END_OF_LINE); buf.insert_txt("\n"); vma.kbd.set_mode(:insert) }, "Open a new line below and switch to INSERT mode")
|
|
351
|
+
reg_act("mode.replace", proc { vma.kbd.set_mode(:replace) }, "Switch to REPLACE mode")
|
|
352
|
+
reg_act("mode.visual.exit", proc { buf.end_visual_mode }, "Leave VISUAL mode")
|
|
353
|
+
reg_act("mode.audio", proc { vma.kbd.set_mode(:audio) }, "Switch to audio playback mode")
|
|
354
|
+
reg_act("mode.browse.center", proc { center_on_current_line(); call_action("mode.browse.exit") }, "Center on the cursor line and leave browse mode")
|
|
355
|
+
|
|
356
|
+
reg_act("edit.insert.char", proc { |c| buf.insert_txt(c) }, "Insert <char>")
|
|
357
|
+
reg_act("edit.insert.space", proc { buf.insert_txt(" ") }, "Insert a space")
|
|
358
|
+
reg_act("edit.insert.password", proc { generate_password_to_buf(15) }, "Insert a random 15-character password")
|
|
359
|
+
reg_act("edit.tab", proc { buf.insert_tab }, "Insert a tab or spaces (indents the selection in VISUAL mode)")
|
|
360
|
+
reg_act("edit.untab", proc { buf.unindent }, "Unindent the current line one level")
|
|
361
|
+
reg_act("edit.line.below", proc { buf.jump(END_OF_LINE); buf.insert_txt("\n") }, "Insert an empty line below")
|
|
362
|
+
reg_act("edit.line.join", proc { buf.join_lines() }, "Join the next line to the current line")
|
|
363
|
+
reg_act("edit.copy.line.end", proc { buf.copy(:to_line_end) }, "Copy to the end of the line")
|
|
364
|
+
reg_act("edit.copy.line.start", proc { buf.copy(:to_line_start) }, "Copy to the start of the line")
|
|
365
|
+
reg_act("edit.copy.word.end", proc { buf.copy(:to_word_end) }, "Copy to the end of the word")
|
|
366
|
+
reg_act("edit.copy.word.next", proc { buf.copy(:to_next_word) }, "Copy to the start of the next word")
|
|
367
|
+
reg_act("edit.copy.mark", proc { |c| buf.copy(:to_mark, c) }, "Copy to mark <char>")
|
|
368
|
+
reg_act("edit.delete.mark", proc { |c| buf.delete2(:to_mark, c) }, "Delete to mark <char>")
|
|
369
|
+
reg_act("edit.delete.find.next", proc { |c| buf.delete2(:to_char, c) }, "Delete up to the next <char>")
|
|
370
|
+
reg_act("edit.delete.find.prev", proc { |c| buf.delete2(:to_char_backward, c) }, "Delete back to the previous <char>")
|
|
371
|
+
reg_act("edit.delete.space.next", proc { buf.delete2(:to_char, " ") }, "Delete up to the next space")
|
|
372
|
+
reg_act("edit.delete.space.prev", proc { buf.delete2(:to_char_backward, " ") }, "Delete back to the previous space")
|
|
373
|
+
reg_act("edit.replace.char", proc { |c| buf.replace_with_char(c) }, "Replace the character under the cursor with <char>")
|
|
374
|
+
reg_act("edit.replace.space", proc { buf.replace_with_char(" ") }, "Replace the character under the cursor with a space")
|
|
375
|
+
reg_act("edit.replace.char.next", proc { |c| buf.replace_with_char(c); buf.move(FORWARD_CHAR) }, "Replace the character under the cursor with <char> and move forward")
|
|
376
|
+
reg_act("edit.register", proc { |c| vma.set_register(c) }, "Use register <char> for the next copy, delete or paste")
|
|
377
|
+
reg_act("edit.paste.register", proc { |c| buf.paste(BEFORE, c) }, "Paste from register <char> before the cursor")
|
|
378
|
+
reg_act("edit.insert.register", proc { |c| buf.insert_register(c) }, "Insert the text of register <char>")
|
|
379
|
+
reg_act("edit.register.list", proc { show_registers }, "Show the registers")
|
|
380
|
+
reg_act("edit.comment.line", proc { buf.comment_line() }, "Comment the current line")
|
|
381
|
+
reg_act("edit.comment.line.off", proc { buf.comment_line(:uncomment) }, "Uncomment the current line")
|
|
382
|
+
reg_act("edit.comment.off", proc { buf.comment_selection(:uncomment) }, "Uncomment the selection")
|
|
383
|
+
reg_act("edit.complete.next", proc { vma.buf.view.autocp_select_next }, "Select the next completion")
|
|
384
|
+
reg_act("edit.complete.prev", proc { vma.buf.view.autocp_select_previous }, "Select the previous completion")
|
|
385
|
+
reg_act("edit.complete.accept", proc { vma.buf.view.autocp_select }, "Insert the selected completion")
|
|
386
|
+
reg_act("edit.complete.hide", proc { vma.buf.view.hide_completions }, "Hide the completion popup")
|
|
387
|
+
|
|
388
|
+
reg_act("sel.char.next", proc { insert_select_move(FORWARD_CHAR) }, "Extend the selection one character forward")
|
|
389
|
+
reg_act("sel.char.prev", proc { insert_select_move(BACKWARD_CHAR) }, "Extend the selection one character backward")
|
|
390
|
+
reg_act("sel.page.next", proc { insert_select_move(:pagedown) }, "Extend the selection a page down")
|
|
391
|
+
reg_act("sel.page.prev", proc { insert_select_move(:pageup) }, "Extend the selection a page up")
|
|
392
|
+
reg_act("sel.line.start", proc { buf.continue_selection; buf.jump(BEGINNING_OF_LINE) }, "Extend the selection to the beginning of the line")
|
|
393
|
+
reg_act("sel.line.end", proc { buf.continue_selection; buf.jump(END_OF_LINE) }, "Extend the selection to the end of the line")
|
|
394
|
+
reg_act("sel.delete", proc { buf.delete(SELECTION) }, "Delete the selection")
|
|
395
|
+
reg_act("sel.delete.append", proc { buf.delete(SELECTION, :append) }, "Delete the selection and append it to the clipboard")
|
|
396
|
+
reg_act("sel.copy.append", proc { buf.copy_active_selection(:append) }, "Append the selection to the clipboard")
|
|
397
|
+
reg_act("sel.indent.more", proc { buf.indent_selection }, "Indent the selected lines one level")
|
|
398
|
+
reg_act("sel.indent.less", proc { buf.unindent_selection }, "Unindent the selected lines one level")
|
|
399
|
+
|
|
400
|
+
reg_act("mark.set", proc { |c| buf.mark_current_position(c) }, "Set mark <char> at the cursor")
|
|
401
|
+
reg_act("mark.jump", proc { |c| buf.jump_to_mark(c) }, "Jump to mark <char>")
|
|
402
|
+
|
|
403
|
+
reg_act("macro.record", proc { |c| vma.kbd.set_mode(:macro); vma.macro.start_recording(c) }, "Record a macro into register <char>")
|
|
404
|
+
reg_act("macro.record.stop", proc { vma.kbd.to_previous_mode; vma.macro.end_recording }, "Stop recording the macro")
|
|
405
|
+
reg_act("macro.run", proc { |c| vma.macro.run_macro(c) }, "Run macro <char>")
|
|
406
|
+
reg_act("macro.save", proc { vma.macro.save }, "Save the recorded and named macros")
|
|
407
|
+
reg_act("macro.save.a", proc { vma.macro.save_macro("a") }, "Save macro a as a Ruby file")
|
|
408
|
+
|
|
409
|
+
reg_act("buf.switch.last", proc { bufs.switch_to_last_buf }, "Switch to the last used buffer")
|
|
410
|
+
reg_act("buf.close.scrap", proc { bufs.close_scrap_buffers }, "Close all buffers that have no file")
|
|
411
|
+
reg_act("buf.list.save", proc { save_buffer_list }, "Save the list of open buffers")
|
|
412
|
+
reg_act("buf.list.load", proc { load_buffer_list }, "Open the saved list of buffers")
|
|
413
|
+
|
|
414
|
+
reg_act("debug.deltas", proc { debug_dump_deltas }, "Print the change deltas of the buffer")
|
|
415
|
+
reg_act("debug.clipboard", proc { debug_dump_clipboard }, "Print the clipboard contents")
|
|
416
|
+
reg_act("debug.buf.print", proc { debug_print_buffer }, "Print the buffer object and its text")
|
|
417
|
+
reg_act("debug.overlay.clear", proc { vma.gui.clear_overlay }, "Clear the drawing overlay")
|
|
418
|
+
reg_act("debug.pry", proc { require "pry"; binding.pry }, "Open a pry console in the terminal")
|
|
419
|
+
|
|
330
420
|
def gui_select_buffer_language
|
|
331
421
|
lm = GtkSource::LanguageManager.new
|
|
332
422
|
lm.set_search_path(lm.search_path << ppath("lang/"))
|