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
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 9b9f8e01a0389ef6c6bb5f04616856b2d6fa8e99c9ec178507eb3ece03084bd4
|
|
4
|
+
data.tar.gz: '0868c083559ba6d905586816333200fe70f5c45eaed306de522f3a89b0791caa'
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2b7c3a573ca292a07b9e93b5db746b8884f99b2c04b9a9e193481751f8e51fa4280cdec82b625782d1100f8109ac46944a4c0b82c2a681ea70041f779ba5360f
|
|
7
|
+
data.tar.gz: 88be098c45d80459e6e725a0da2da180e18e14ee1d94f6e391ea0bc5fb4808d34cd77d952b3dc1ab839b2fed0d69ca9df76c328d9a8738125c592bb7b096f5d9
|
|
@@ -47,36 +47,43 @@ jobs:
|
|
|
47
47
|
- name: Test on a clean Ubuntu 24.04
|
|
48
48
|
run: scripts/appimage/smoke_test.sh build/appimage/Vimamsa-*-x86_64.AppImage
|
|
49
49
|
|
|
50
|
-
#
|
|
50
|
+
# The file with its version (Vimamsa-0.1.28-x86_64.AppImage), and the
|
|
51
|
+
# same file under one name for every release, so the README can link to
|
|
51
52
|
# releases/latest/download/Vimamsa-x86_64.AppImage
|
|
52
|
-
- name: Name the
|
|
53
|
+
- name: Name the files
|
|
53
54
|
run: |
|
|
54
55
|
mkdir -p dist
|
|
55
|
-
|
|
56
|
-
|
|
56
|
+
f=$(ls build/appimage/Vimamsa-*-x86_64.AppImage)
|
|
57
|
+
cp "$f" dist/
|
|
58
|
+
cp "$f" dist/Vimamsa-x86_64.AppImage
|
|
59
|
+
(cd dist && for a in *.AppImage; do sha256sum "$a" > "$a.sha256"; done)
|
|
57
60
|
|
|
58
61
|
- name: Attest build provenance
|
|
59
62
|
if: github.ref_type == 'tag'
|
|
60
63
|
uses: actions/attest-build-provenance@v2
|
|
61
64
|
with:
|
|
62
|
-
subject-path: dist
|
|
65
|
+
subject-path: dist/*.AppImage
|
|
63
66
|
|
|
64
67
|
- name: Attach to the release
|
|
65
68
|
if: github.ref_type == 'tag'
|
|
66
69
|
env:
|
|
67
70
|
GH_TOKEN: ${{ github.token }}
|
|
68
71
|
run: |
|
|
69
|
-
|
|
72
|
+
v="${GITHUB_REF_NAME#v}"
|
|
73
|
+
notes="Download \`Vimamsa-$v-x86_64.AppImage\`, make it executable and run it:
|
|
70
74
|
|
|
71
75
|
\`\`\`
|
|
72
|
-
chmod +x Vimamsa-x86_64.AppImage
|
|
73
|
-
./Vimamsa-x86_64.AppImage
|
|
76
|
+
chmod +x Vimamsa-$v-x86_64.AppImage
|
|
77
|
+
./Vimamsa-$v-x86_64.AppImage
|
|
74
78
|
\`\`\`
|
|
75
79
|
|
|
80
|
+
\`Vimamsa-x86_64.AppImage\` is the same file under the name every release has
|
|
81
|
+
(the README links to the latest one).
|
|
82
|
+
|
|
76
83
|
Needs x86_64 Linux with glibc 2.39 or newer (Ubuntu 24.04, Fedora 40, Debian 13 or newer).
|
|
77
84
|
|
|
78
85
|
Built by GitHub Actions from this tag. To check that the file came from this repository's workflow:
|
|
79
|
-
\`gh attestation verify Vimamsa-x86_64.AppImage --repo $GITHUB_REPOSITORY\`"
|
|
86
|
+
\`gh attestation verify Vimamsa-$v-x86_64.AppImage --repo $GITHUB_REPOSITORY\`"
|
|
80
87
|
if gh release view "$GITHUB_REF_NAME" >/dev/null 2>&1; then
|
|
81
88
|
gh release upload "$GITHUB_REF_NAME" dist/* --clobber
|
|
82
89
|
else
|
|
@@ -88,6 +95,6 @@ jobs:
|
|
|
88
95
|
if: github.ref_type != 'tag'
|
|
89
96
|
uses: actions/upload-artifact@v4
|
|
90
97
|
with:
|
|
91
|
-
name: Vimamsa-
|
|
98
|
+
name: Vimamsa-AppImage
|
|
92
99
|
path: dist/
|
|
93
100
|
retention-days: 14
|
data/Dockerfile
CHANGED
|
@@ -42,7 +42,7 @@ RUN git clone https://github.com/SamiSieranoja/vimamsa.git && cd vimamsa && gem
|
|
|
42
42
|
RUN chmod a-w -R /usr/local/bundle/gems/vimamsa*
|
|
43
43
|
RUN chmod a-w -R vimamsa
|
|
44
44
|
|
|
45
|
-
CMD ["bash", "-c", "xvfb-run -a ruby /usr/local/bundle/gems/vimamsa-*/run_tests.rb
|
|
46
|
-
# CMD ["bash", "-c", "cd vimamsa && xvfb-run -a ruby run_tests.rb"]
|
|
45
|
+
CMD ["bash", "-c", "xvfb-run -a ruby /usr/local/bundle/gems/vimamsa-*/exe/run_tests.rb"]
|
|
46
|
+
# CMD ["bash", "-c", "cd vimamsa && xvfb-run -a ruby exe/run_tests.rb"]
|
|
47
47
|
|
|
48
48
|
|
data/README.md
CHANGED
|
@@ -16,11 +16,14 @@ Vi/Vim -inspired experimental GUI-oriented text editor written with Ruby and GTK
|
|
|
16
16
|
|
|
17
17
|
## Download (AppImage)
|
|
18
18
|
|
|
19
|
+
[](https://github.com/SamiSieranoja/vimamsa/releases/latest)
|
|
20
|
+
|
|
19
21
|
The easiest way: one file, nothing to install (Ruby, GTK and everything else
|
|
20
22
|
the editor needs are inside it).
|
|
21
23
|
|
|
22
|
-
1. Download [Vimamsa-x86_64.AppImage](https://github.com/SamiSieranoja/vimamsa/releases/latest/download/Vimamsa-x86_64.AppImage)
|
|
23
|
-
(
|
|
24
|
+
1. Download [Vimamsa-x86_64.AppImage](https://github.com/SamiSieranoja/vimamsa/releases/latest/download/Vimamsa-x86_64.AppImage),
|
|
25
|
+
the latest release (each release also has the file with its version in
|
|
26
|
+
the name, e.g. Vimamsa-0.1.28-x86_64.AppImage: [Releases](https://github.com/SamiSieranoja/vimamsa/releases)).
|
|
24
27
|
2. Make it executable and run it:
|
|
25
28
|
```
|
|
26
29
|
chmod +x Vimamsa-x86_64.AppImage
|
|
@@ -49,12 +52,14 @@ gh attestation verify Vimamsa-x86_64.AppImage --repo SamiSieranoja/vimamsa
|
|
|
49
52
|
## Install as a Ruby gem
|
|
50
53
|
|
|
51
54
|
Requirements:
|
|
52
|
-
- Ruby 3.
|
|
55
|
+
- Ruby 3.2+
|
|
53
56
|
- GTK 4
|
|
54
57
|
|
|
55
|
-
On Ubuntu (
|
|
58
|
+
On Ubuntu (24.04):
|
|
56
59
|
```
|
|
57
|
-
sudo apt install ruby-dev build-essential
|
|
60
|
+
sudo apt install ruby-dev build-essential pkg-config \
|
|
61
|
+
libgtk-4-dev libgtksourceview-5-dev libvte-2.91-gtk4-dev \
|
|
62
|
+
libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev
|
|
58
63
|
sudo gem install vimamsa
|
|
59
64
|
```
|
|
60
65
|
|
|
@@ -85,11 +90,18 @@ Install packages for optional features:
|
|
|
85
90
|
sudo apt install ack-grep clang-format
|
|
86
91
|
```
|
|
87
92
|
|
|
88
|
-
For customization, edit ~/.vimamsa/custom.rb
|
|
93
|
+
For customization, edit ~/.config/vimamsa/custom.rb (Settings ▸ Customize).
|
|
94
|
+
|
|
95
|
+
Vimamsa keeps the files you edit (custom.rb, settings.rb, styles, bookmarks,
|
|
96
|
+
named macros) in ~/.config/vimamsa, and the files it generates (session,
|
|
97
|
+
histories, file index, backups, crash reports) in ~/.local/share/vimamsa
|
|
98
|
+
(`$XDG_CONFIG_HOME` / `$XDG_DATA_HOME` if set). `--user-dir DIR` puts both in
|
|
99
|
+
DIR. Files of older versions in ~/.vimamsa or ~/.config/vimamsa are moved to
|
|
100
|
+
their new places at the first start.
|
|
89
101
|
|
|
90
102
|
## Demo
|
|
91
103
|
|
|
92
|
-
|
|
104
|
+
[<video src="https://github.com/user-attachments/assets/626bc896-7e15-4e21-a013-4572cf5532a6" autoplay muted loop playsinline width="800"></video>](https://github.com/user-attachments/assets/626bc896-7e15-4e21-a013-4572cf5532a6)
|
|
93
105
|
|
|
94
106
|
Moving with `h j k l` and `w e b`, `y y p`, `d d`, undo `u` / redo `ctrl-r`,
|
|
95
107
|
typing in Insert mode and back to Command mode with `ctrl` (press and release
|
|
@@ -97,100 +109,140 @@ it alone), selecting in Visual mode, and easy jump (`s`: type a word's label to
|
|
|
97
109
|
jump there). The key log panel on the right (View ▸ Toggle
|
|
98
110
|
key log panel) shows each key and the action it ran.
|
|
99
111
|
|
|
112
|
+
The editor plays this demo and others itself: the introduction page (shown on
|
|
113
|
+
the first start, and from Help ▸ Introduction) has a button for each. It also
|
|
114
|
+
links to a one-screen summary for Vim users (Help ▸ Vimamsa for Vim users).
|
|
115
|
+
`vimamsa --intro` shows the introduction page at start whatever the settings
|
|
116
|
+
say.
|
|
117
|
+
|
|
100
118
|
## Key bindings
|
|
101
119
|
|
|
102
|
-
|
|
120
|
+
The default keybinding scheme, "vimlike", is close to Vim. It keeps the Vim
|
|
121
|
+
bindings and changes a few keys for its own features. For the full list, see
|
|
122
|
+
the menu item "Help ▸ Show key bindings" and the file
|
|
123
|
+
lib/vimamsa/key_bindings_vimlike.rb. You can switch the scheme in Settings
|
|
124
|
+
("Keybinding scheme", applied after a restart) or with
|
|
125
|
+
`cnf.keybindings.scheme = "vim"` in ~/.config/vimamsa/settings.rb:
|
|
103
126
|
|
|
104
|
-
|
|
127
|
+
- `vimlike` (default): Vim keys plus the extra bindings below
|
|
128
|
+
- `vim`: plain Vim bindings
|
|
129
|
+
- `notepad`: non-modal, stays in insert mode (gedit/notepad style)
|
|
105
130
|
|
|
106
|
-
|
|
131
|
+
Keys that work much like in Vim:
|
|
132
|
+
|
|
133
|
+
In Command mode:
|
|
107
134
|
```
|
|
108
|
-
j k l
|
|
109
|
-
|
|
135
|
+
h j k l w b e W B E 0 ^ $ gg G <count>G f F t T ; * / n N : gf g;
|
|
136
|
+
i a A I o J p P D Y S u ctrl-r . x ~ r<char> R v m<char> '<char> `<char>
|
|
137
|
+
q<char> @<char> "<char> ctrl-f ctrl-b ctrl-d ctrl-u ctrl-a
|
|
110
138
|
```
|
|
139
|
+
Operators `d c y gU gu g~ > <` combine with the motions above and with text
|
|
140
|
+
objects (`iw aw i( a" it ...`), e.g. `d w`, `c i w`, `y y`, `> >`.
|
|
111
141
|
|
|
112
142
|
In Visual mode:
|
|
113
143
|
```
|
|
114
|
-
d y gU gu
|
|
144
|
+
d x y c J u U ~ gU gu > < iw aw ...
|
|
115
145
|
```
|
|
116
146
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
- ctrl
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
147
|
+
The keys that work differently from Vim are listed in the tables below
|
|
148
|
+
(the full list of conflicts is in doc/vimlike_vim_conflicts.md).
|
|
149
|
+
|
|
150
|
+
Syntax:
|
|
151
|
+
|
|
152
|
+
- `ctrl!` means press and immediately release the ctrl key. Triggered by the key up event when no other keys were pressed between the key down and key up events.
|
|
153
|
+
- `ctrl-x` means press and hold the ctrl key, press x.
|
|
154
|
+
- `, a` means press `,`, then `a`.
|
|
155
|
+
|
|
156
|
+
**Command mode**
|
|
157
|
+
|
|
158
|
+
| Key | Action |
|
|
159
|
+
|---|---|
|
|
160
|
+
| `ctrl!` | Switch between command and insert modes |
|
|
161
|
+
| `shift!` `s` | Save file (press and release shift, then `s`) |
|
|
162
|
+
| `s` | Easy jump (similar to Vim [EasyMotion](https://github.com/easymotion/vim-easymotion)): type a word's label to jump there |
|
|
163
|
+
| `z` | Enter BROWSE mode |
|
|
164
|
+
| `O` | Move to end of line |
|
|
165
|
+
| `X` | Insert an empty line below |
|
|
166
|
+
| `tab` | Switch between current and previous buffer |
|
|
167
|
+
| `M` | Run the last recorded macro |
|
|
168
|
+
| `enter` | On a link: open url in browser. On `/path/to/file.txt:linenum`: open the file, jump to linenum |
|
|
169
|
+
| `space <char>` | Insert character `<char>` |
|
|
170
|
+
| `ctrl-o` | Open file |
|
|
171
|
+
| `ctrl-s` | Save file |
|
|
172
|
+
| `ctrl-w` | Close buffer |
|
|
173
|
+
| `ctrl-c` / `ctrl-x` | Comment / uncomment line |
|
|
174
|
+
| `ctrl-q` | Quit |
|
|
175
|
+
| `g s` | Easy Jump to a file in the file panel|
|
|
176
|
+
| `alt-h` / `alt-l` | Previous / next file in the file panel |
|
|
177
|
+
| `, b` | Switch buffer (buffer manager) |
|
|
178
|
+
| `, f` | File explorer: browse directories (`h` parent directory, `l` or `enter` open) |
|
|
179
|
+
| `, z` | File finder (fuzzy search for file names) |
|
|
180
|
+
| `, h` | File history |
|
|
181
|
+
| `, g` | Grep: Search for a string in the current buffer, show matching lines |
|
|
182
|
+
| `, a` | Search in files using ack |
|
|
183
|
+
| `, r r` | Search and replace |
|
|
184
|
+
| `, e` or `:` | Command line |
|
|
185
|
+
| `, s a` | Save as |
|
|
186
|
+
| `, n b` | New buffer |
|
|
187
|
+
| `, c b` | Close buffer |
|
|
188
|
+
| `, r v b` | Revert buffer from disk |
|
|
189
|
+
| `, M` / `, '` | Add bookmark / list bookmarks |
|
|
190
|
+
| `, v` | Auto-indent buffer |
|
|
191
|
+
| `, , w` | Toggle two-column view |
|
|
192
|
+
| `, w` | Switch between columns |
|
|
193
|
+
| `, m h` | Show messages (toggle) |
|
|
194
|
+
|
|
195
|
+
**Insert mode** (similar to bash or emacs)
|
|
196
|
+
|
|
197
|
+
| Key | Action |
|
|
198
|
+
|---|---|
|
|
199
|
+
| `ctrl!` or `esc` | Switch to command mode |
|
|
200
|
+
| `ctrl-n` / `ctrl-p` | Move to next / previous line |
|
|
201
|
+
| `ctrl-a` / `ctrl-e` | Move to beginning / end of line |
|
|
202
|
+
| `ctrl-b` / `ctrl-f` | Move backward / forward one char |
|
|
203
|
+
| `alt-b` / `alt-f` | Move backward / forward one word |
|
|
204
|
+
| `ctrl-d` | Delete to end of word |
|
|
205
|
+
| `ctrl-z` / `ctrl-y` | Undo / redo |
|
|
206
|
+
| `ctrl-c` / `ctrl-x` / `ctrl-v` | Copy / cut / paste |
|
|
207
|
+
| `shift-<arrow>` | Select |
|
|
208
|
+
| `ctrl-l` / `ctrl-g` | Search in buffer / next match |
|
|
209
|
+
| `ctrl-space` or `ctrl-h` | Show completions (`tab` / `shift-tab` to choose, `shift!` to accept) |
|
|
210
|
+
| `alt-s` | Easy jump |
|
|
211
|
+
| `ctrl-s` | Save file |
|
|
212
|
+
|
|
213
|
+
**Visual mode**
|
|
214
|
+
|
|
215
|
+
| Key | Action |
|
|
216
|
+
|---|---|
|
|
217
|
+
| `ctrl!` or `esc` | Exit visual mode |
|
|
218
|
+
| `s` | Easy jump: extend the selection to a word's label |
|
|
219
|
+
| `tab` / `shift-tab` | Indent / unindent selection |
|
|
220
|
+
| `ctrl-c` / `ctrl-x` | Comment / uncomment selection |
|
|
221
|
+
| `a y` / `a d` | Copy / delete, appending to the clipboard |
|
|
222
|
+
| `g c` / `g s` | Capitalize / swap case |
|
|
223
|
+
| `g r` | Reverse selection |
|
|
224
|
+
| `g w` | Remove extra spaces |
|
|
225
|
+
| `, t b` / `, t i` / `, t l` | Bold / italic / link (hyperplaintext) |
|
|
226
|
+
|
|
227
|
+
**Browse mode** (enter with `z`)
|
|
228
|
+
|
|
229
|
+
| Key | Action |
|
|
230
|
+
|---|---|
|
|
231
|
+
| `h` / `l` | Previous / next buffer in history |
|
|
232
|
+
| `q` / `w` | Previous / next edited position |
|
|
233
|
+
| `p` / `n` | Previous / next file in the file panel |
|
|
234
|
+
| `s` / `d` | Page up / down |
|
|
235
|
+
| `e` / `r` | Quarter page up / down |
|
|
236
|
+
| `i` / `o` | Start / end of buffer |
|
|
237
|
+
| `z` | Center the current line, back to command mode |
|
|
238
|
+
| `m` | Run the last recorded macro |
|
|
239
|
+
| `c` | Close buffer |
|
|
240
|
+
| `j`, `esc`, `enter` or `ctrl!` | Back to command mode |
|
|
241
|
+
|
|
242
|
+
Bindings can be customized in ~/.config/vimamsa/custom.rb.
|
|
243
|
+
For example, to bind ctrl-n to action "create new file":
|
|
191
244
|
```
|
|
192
|
-
bindkey 'C ctrl-n',
|
|
193
|
-
|
|
245
|
+
bindkey 'C ctrl-n', 'buf.new'
|
|
194
246
|
```
|
|
195
247
|
|
|
196
248
|
custom.rb is loaded in two phases. The body of the file runs early, before
|
|
@@ -206,7 +258,7 @@ end
|
|
|
206
258
|
|
|
207
259
|
|
|
208
260
|
## Known issues
|
|
209
|
-
- Cursor sometimes vanishes when dragging or resizing the window.
|
|
261
|
+
- Cursor sometimes vanishes (e.g. when dragging or resizing the window). A manifestation of a GTK bug, fixed in new GTK4 versions ( >= 4.18, in Ubuntu Ubuntu 25.04+). Workaround is to press ctrl key twice.
|
|
210
262
|
|
|
211
263
|
## Current limitations
|
|
212
264
|
- Linux only
|
|
@@ -215,4 +267,24 @@ Mainly tested with:
|
|
|
215
267
|
- UTF8, English or Finnish
|
|
216
268
|
- Line endings with "\n"
|
|
217
269
|
|
|
270
|
+
## History
|
|
271
|
+
|
|
272
|
+
The name ```vimamsa``` was taken from a Pali language dictionary. It can mean `experiment`, `investigation` or `review`.
|
|
273
|
+
|
|
274
|
+
This software has been in development since at least 2015. Since 2025, development has been done mainly using AI tools (claude).
|
|
275
|
+
|
|
276
|
+
## Design goals and future plans
|
|
277
|
+
|
|
278
|
+
- GUI-based instead of focusing on running in terminal
|
|
279
|
+
- Separate key bindings from actions. Should be able to adapt any type of editor keybindings.
|
|
280
|
+
- Compatibility with the most popular vim features
|
|
281
|
+
- More modes than in vim(?) and with flexible customization.
|
|
282
|
+
- Extending with Ruby only.
|
|
283
|
+
- Support for images and other graphical elements
|
|
284
|
+
- Vim-style editing, but hopefully easier to learn.
|
|
285
|
+
- Should have a proper module API. But APIs are often too limited. Should also allow user access to all internal functions and to be able to break stuff.
|
|
286
|
+
|
|
287
|
+
In future:
|
|
288
|
+
- WYSIWYG -editing (replacing need for LaTeX or Word)
|
|
289
|
+
- All-in-one approach like in Emacs. Email, File management, Terminal, Playing audio. Control everything with vim-bindings.
|
|
218
290
|
|
data/custom_example.rb
CHANGED
|
@@ -5,16 +5,25 @@
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
# Eval selected text as ruby code (e.g. use as calculator):
|
|
8
|
-
# bindkey "V , e", "
|
|
9
|
-
# syntax: bindkey "mode key1 key2 ..."
|
|
8
|
+
# bindkey "V , e", "sel.convert.eval"
|
|
9
|
+
# syntax: bindkey "mode key1 key2 ...", "action.id"
|
|
10
10
|
|
|
11
11
|
# Execute in new gnome-terminal tab
|
|
12
|
-
# bindkey "C , , t",
|
|
12
|
+
# bindkey "C , , t", "term.line"
|
|
13
13
|
|
|
14
|
-
#
|
|
14
|
+
# Actions have dotted ids, from general to specific: "move.word.next",
|
|
15
|
+
# "buf.save", "sel.copy" (Search for Actions, [C] , , s, lists them). Bind one
|
|
16
|
+
# by its id, or with the a.… form, which reports a typo when the binding is made:
|
|
17
|
+
# bindkey "C , i w", a.move.word.next
|
|
18
|
+
# Run one from here or from the command line (:) with a trailing "!":
|
|
19
|
+
# a.buf.save!
|
|
20
|
+
# Your own actions: use the "custom." namespace, as below.
|
|
21
|
+
|
|
22
|
+
# Settings are cnf.* values (the Settings dialog writes them to settings.rb):
|
|
23
|
+
# cnf.tab.width = 4
|
|
15
24
|
|
|
16
25
|
# Open this file every time the program starts
|
|
17
|
-
cnf.startup_file = "~/Documents/startup.txt"
|
|
26
|
+
# cnf.startup_file = "~/Documents/startup.txt"
|
|
18
27
|
|
|
19
28
|
|
|
20
29
|
|
|
@@ -43,11 +52,11 @@ def collect_c_header()
|
|
|
43
52
|
buf.insert_txt(s)
|
|
44
53
|
end
|
|
45
54
|
|
|
46
|
-
reg_act(
|
|
55
|
+
reg_act("custom.c_header", proc { collect_c_header }, "Collect function definitions for c header file")
|
|
47
56
|
|
|
48
57
|
# Extract all numbers from txt selection
|
|
49
58
|
c = Converter.new(lambda { |x| x.scan(/([\+\-]?\d+(\.\d+)?)/).collect { |x| x[0] }.join(" ") }, :lambda, :getnums)
|
|
50
|
-
# (
|
|
59
|
+
# (action sel.convert.getnums; in the action search, e.g. "conv getnum")
|
|
51
60
|
|
|
52
61
|
|
|
53
62
|
def insert_lorem_ipsum()
|
|
@@ -60,7 +69,7 @@ Curabitur pretium tincidunt lacus. Nulla gravida orci a odio. Nullam varius, tur
|
|
|
60
69
|
end
|
|
61
70
|
|
|
62
71
|
# Find with action search ([C] , , s)
|
|
63
|
-
reg_act(
|
|
72
|
+
reg_act("custom.lorem_ipsum", proc { insert_lorem_ipsum }, "Insert lorem ipsum")
|
|
64
73
|
|
|
65
74
|
def open_mtg(urlpref = nil)
|
|
66
75
|
require "uri"
|
|
@@ -68,20 +77,25 @@ def open_mtg(urlpref = nil)
|
|
|
68
77
|
vma.buf.get_current_selection.strip
|
|
69
78
|
else
|
|
70
79
|
l = vma.buf.get_current_line.strip
|
|
71
|
-
m = l.match(/(\w[\w\'
|
|
80
|
+
m = l.match(/(\w[\w\'\-\,\s]+)/)
|
|
72
81
|
m ? m[0].strip : nil
|
|
73
82
|
end
|
|
74
83
|
return if cardname.nil? || cardname.empty?
|
|
75
84
|
u = URI.encode_www_form_component(cardname)
|
|
85
|
+
message(u)
|
|
76
86
|
url = urlpref ? urlpref + u : "https://gatherer.wizards.com/Pages/Card/Details.aspx?name=#{u}"
|
|
77
87
|
open_url(url)
|
|
78
88
|
end
|
|
79
89
|
|
|
80
|
-
# reg_act(
|
|
81
|
-
# bindkey "VC , , m",
|
|
82
|
-
# Try on this line:
|
|
90
|
+
# reg_act("custom.mtg", proc { open_mtg }, "open mtg card info")
|
|
91
|
+
# bindkey "VC , , m", "custom.mtg"
|
|
92
|
+
# Try on this line (keys ", , m" in command or visual mode):
|
|
83
93
|
# Restless Cottage
|
|
84
94
|
|
|
95
|
+
# The introduction page (Help ▸ Introduction) is shown at start once. To show
|
|
96
|
+
# it at every start:
|
|
97
|
+
# cnf.intro.show_on_startup = true
|
|
98
|
+
|
|
85
99
|
# Primitive support for LSP (not well tested)
|
|
86
100
|
# To enable LSP:
|
|
87
101
|
# cnf.lsp.enabled = true
|
|
@@ -91,11 +105,15 @@ end
|
|
|
91
105
|
# cnf.lsp.server.solargraph.languages = ["ruby"]
|
|
92
106
|
|
|
93
107
|
# ruby-lsp (Ruby):
|
|
94
|
-
#
|
|
108
|
+
# The AppImage puts its own ruby-lsp on PATH. "bundle exec" only works when
|
|
109
|
+
# the editor's current directory (or a parent) has a Gemfile; started from
|
|
110
|
+
# anywhere else it fails ("Could not locate Gemfile") for every Ruby buffer.
|
|
111
|
+
# cnf.lsp.server.ruby_lsp = { name: "ruby-lsp",
|
|
112
|
+
# command: ENV["APPIMAGE"] ? "ruby-lsp" : "bundle exec ruby-lsp", type: "stdio" }
|
|
95
113
|
# cnf.lsp.server.ruby_lsp.languages = ["ruby"]
|
|
96
114
|
|
|
97
115
|
|
|
98
|
-
# cnf.lsp.server.clangd = { name: "clangd", command: "clangd
|
|
116
|
+
# cnf.lsp.server.clangd = { name: "clangd", command: "clangd --offset-encoding=utf-8", type: "stdio" }
|
|
99
117
|
# cnf.lsp.server.clangd.languages = ["c", "cpp"]
|
|
100
118
|
|
|
101
119
|
# Autocomplete (word completion popup in insert mode). Disabled by default.
|
|
@@ -123,6 +141,6 @@ end
|
|
|
123
141
|
# file selector, "grep") do not exist yet at that point: bindings for those go
|
|
124
142
|
# here, in a function that is called after everything has been loaded.
|
|
125
143
|
# def hook_custom_after_init
|
|
126
|
-
# bindkey "fexp , x",
|
|
144
|
+
# bindkey "fexp , x", "custom.my_file_action"
|
|
127
145
|
# end
|
|
128
146
|
|