vimamsa 0.1.26 → 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.
- checksums.yaml +4 -4
- data/.github/workflows/appimage.yml +93 -0
- data/.gitignore +4 -1
- data/Dockerfile +7 -4
- data/README.md +195 -99
- data/custom_example.rb +59 -17
- data/doc/TODO.md +678 -0
- data/doc/action_names_plan.md +442 -0
- data/doc/bundling_plan.md +570 -0
- 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 +213 -0
- data/doc/line_tree_plan.md +89 -0
- data/doc/missing_vim_bindings.md +61 -0
- data/doc/modules_settings_plan.md +433 -0
- data/doc/refactor_dedup_plan.md +117 -0
- data/doc/registries_plan.md +202 -0
- data/doc/startup_speed_plan.md +97 -0
- data/doc/treap_visualizer.html +585 -0
- data/doc/unused_code_plan.md +120 -0
- data/doc/vim_compatibility_plan.md +451 -0
- data/doc/vimlike_vim_conflicts.md +262 -0
- data/doc/vm_snapshots_plan.md +146 -0
- data/doc/wysiwyg_plan.md +231 -0
- data/exe/run_tests.rb +124 -3
- data/exe/vimamsa +68 -5
- data/fonts/OFL-Oxanium.txt +93 -0
- data/fonts/Oxanium[wght].ttf +0 -0
- data/help/intro.txt +30 -0
- data/help/vim_intro.txt +31 -0
- data/icon.png +0 -0
- data/img/demo.gif +0 -0
- data/img/demo.mp4 +0 -0
- data/lang/hyperplaintext.lang +7 -1
- data/lib/vimamsa/ack.rb +13 -1
- data/lib/vimamsa/actions.rb +385 -37
- data/lib/vimamsa/appimage_env.rb +35 -0
- data/lib/vimamsa/audio.rb +2 -5
- data/lib/vimamsa/bookmarks.rb +302 -0
- data/lib/vimamsa/buffer.rb +675 -118
- data/lib/vimamsa/buffer_changetext.rb +150 -68
- data/lib/vimamsa/buffer_cursor.rb +7 -0
- data/lib/vimamsa/buffer_list.rb +6 -2
- data/lib/vimamsa/buffer_manager.rb +10 -7
- data/lib/vimamsa/bundled_fonts.rb +32 -0
- data/lib/vimamsa/cli_help.rb +75 -0
- data/lib/vimamsa/clipboard.rb +9 -3
- data/lib/vimamsa/conf.rb +68 -3
- data/lib/vimamsa/constants.rb +3 -0
- data/lib/vimamsa/crash_handler.rb +149 -0
- data/lib/vimamsa/debug.rb +6 -3
- data/lib/vimamsa/demo_player.rb +458 -0
- data/lib/vimamsa/demo_recorder.rb +277 -0
- data/lib/vimamsa/desktop_install.rb +96 -0
- data/lib/vimamsa/diff_buffer.rb +40 -11
- data/lib/vimamsa/dot_repeat.rb +104 -0
- data/lib/vimamsa/easy_jump.rb +57 -3
- data/lib/vimamsa/editor.rb +327 -78
- data/lib/vimamsa/encrypt.rb +78 -29
- data/lib/vimamsa/file_finder.rb +4 -19
- data/lib/vimamsa/file_history.rb +4 -1
- data/lib/vimamsa/file_manager.rb +46 -31
- data/lib/vimamsa/fold.rb +226 -0
- data/lib/vimamsa/form_input.rb +388 -0
- data/lib/vimamsa/gui.rb +603 -119
- data/lib/vimamsa/gui_command_line.rb +247 -0
- data/lib/vimamsa/gui_dialog.rb +94 -42
- data/lib/vimamsa/gui_file_panel.rb +356 -25
- data/lib/vimamsa/gui_form_generator.rb +75 -40
- data/lib/vimamsa/gui_func_panel.rb +67 -22
- data/lib/vimamsa/gui_image.rb +3 -0
- data/lib/vimamsa/gui_key_hint.rb +165 -0
- data/lib/vimamsa/gui_keylog_panel.rb +408 -0
- data/lib/vimamsa/gui_menu.rb +84 -53
- data/lib/vimamsa/gui_select_window.rb +80 -75
- data/lib/vimamsa/gui_settings.rb +86 -41
- data/lib/vimamsa/gui_sourceview.rb +280 -92
- data/lib/vimamsa/gui_sourceview_autocomplete.rb +319 -90
- data/lib/vimamsa/gui_text.rb +63 -2
- data/lib/vimamsa/gui_theme.rb +615 -0
- data/lib/vimamsa/hook.rb +5 -0
- data/lib/vimamsa/hyper_plain_text.rb +3 -0
- data/lib/vimamsa/intro_page.rb +368 -0
- data/lib/vimamsa/key_actions.rb +382 -193
- data/lib/vimamsa/key_binding_tree.rb +467 -273
- data/lib/vimamsa/key_bindings_notepad.rb +45 -0
- data/lib/vimamsa/key_bindings_report.rb +484 -0
- data/lib/vimamsa/key_bindings_vim.rb +104 -0
- data/lib/vimamsa/key_bindings_vimlike.rb +353 -289
- data/lib/vimamsa/key_names.rb +80 -0
- data/lib/vimamsa/langservp.rb +271 -54
- data/lib/vimamsa/line_tree.rb +367 -0
- data/lib/vimamsa/macro.rb +23 -3
- data/lib/vimamsa/main.rb +14 -8
- data/lib/vimamsa/rbvma.rb +41 -1
- data/lib/vimamsa/registers.rb +125 -0
- data/lib/vimamsa/run_ruby.rb +64 -0
- data/lib/vimamsa/search.rb +3 -0
- data/lib/vimamsa/search_replace.rb +15 -14
- data/lib/vimamsa/string_util.rb +134 -40
- data/lib/vimamsa/terminal.rb +3 -0
- data/lib/vimamsa/test_framework.rb +28 -2
- data/lib/vimamsa/tests.rb +11 -8
- data/lib/vimamsa/text_objects.rb +310 -0
- data/lib/vimamsa/text_transforms.rb +18 -0
- data/lib/vimamsa/tmp_user_dir.rb +39 -0
- data/lib/vimamsa/user_dirs.rb +83 -0
- data/lib/vimamsa/util.rb +46 -7
- data/lib/vimamsa/version.rb +1 -1
- data/lib/vimamsa/vim_core.rb +355 -0
- data/lib/vimamsa/vim_operators.rb +365 -0
- data/lib/vimamsa.rb +0 -1
- data/modules/calculator/calculator.rb +5 -5
- data/modules/color_highlight/color_highlight.rb +118 -0
- data/modules/color_highlight/color_highlight_info.rb +3 -0
- data/modules/dictation/dictation.rb +1054 -0
- data/modules/dictation/dictation_info.rb +3 -0
- data/modules/dictation/whisper_worker.py +273 -0
- data/modules/ollama/ollama.rb +107 -0
- data/modules/ollama/ollama_info.rb +3 -0
- data/modules/terminal/terminal.rb +5 -5
- data/modules/tts/tts.rb +119 -0
- data/modules/tts/tts_info.rb +3 -0
- data/run_e2e_vm.sh +28 -0
- data/run_tests_vm.rb +138 -0
- data/scripts/appimage/AppRun +54 -0
- data/scripts/appimage/Dockerfile +18 -0
- data/scripts/appimage/build.sh +19 -0
- data/scripts/appimage/build_in_container.sh +192 -0
- data/scripts/appimage/smoke_test.sh +27 -0
- data/scripts/demo/demo_easyjump_steps.txt +60 -0
- data/scripts/demo/demo_files_steps.txt +52 -0
- data/scripts/demo/demo_steps.txt +67 -0
- data/scripts/demo/notes.txt +6 -0
- data/scripts/demo/record_demo.rb +156 -0
- data/scripts/demo/report.rb +7 -0
- data/scripts/demo/shapes.rb +29 -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/styles/134272-molokai.xml +3 -0
- data/styles/molokai_cyber.xml +48 -0
- data/styles/molokai_edit.xml +1 -0
- data/tests/support/virtual_keyboard.rb +254 -0
- data/tests/support/virtual_mic.rb +67 -0
- data/tests/test_ack.rb +22 -0
- data/tests/test_action_ids.rb +232 -0
- data/tests/test_auto_format.rb +122 -0
- data/tests/test_autocomplete.rb +211 -0
- data/tests/test_autosave.rb +145 -0
- data/tests/test_basic_editing.rb +46 -16
- data/tests/test_bookmarks.rb +206 -0
- data/tests/test_bracket_match.rb +88 -0
- data/tests/test_bundling.rb +92 -0
- data/tests/test_cli_help.rb +64 -0
- data/tests/test_color_highlight.rb +92 -0
- data/tests/test_command_line.rb +79 -0
- data/tests/test_command_line_file.rb +27 -0
- data/tests/test_context_menu_file.rb +147 -0
- data/tests/test_copy_paste.rb +106 -26
- data/tests/test_crash_handler.rb +39 -0
- data/tests/test_custom_two_phase.rb +92 -0
- data/tests/test_demo_player.rb +301 -0
- data/tests/test_demo_recorder.rb +202 -0
- data/tests/test_dialog_callback_errors.rb +44 -0
- data/tests/test_dictation.rb +294 -0
- data/tests/test_diff_buffer_name.rb +51 -0
- data/tests/test_dot_repeat.rb +88 -0
- data/tests/test_double_click.rb +41 -0
- data/tests/test_drag_selection.rb +125 -0
- data/tests/test_e2e_cmdline.rb +116 -0
- data/tests/test_e2e_dictation.rb +98 -0
- data/tests/test_e2e_replace_char.rb +58 -0
- data/tests/test_easy_jump.rb +93 -0
- data/tests/test_extract_file_links.rb +55 -0
- data/tests/test_file_format.rb +217 -0
- data/tests/test_file_manager.rb +72 -0
- data/tests/test_file_panel.rb +269 -0
- data/tests/test_flash.rb +78 -0
- data/tests/test_fold.rb +111 -0
- data/tests/test_font_refresh.rb +56 -0
- data/tests/test_form_input.rb +203 -0
- data/tests/test_func_panel.rb +68 -0
- data/tests/test_grep_apply.rb +46 -0
- data/tests/test_gtk_sync.rb +126 -0
- data/tests/test_hpt_highlight_visible.rb +75 -0
- data/tests/test_hpt_link_highlight.rb +82 -0
- data/tests/test_intro_page.rb +437 -0
- data/tests/test_jump_to_file.rb +41 -0
- data/tests/test_key_bindings.rb +208 -0
- data/tests/test_key_categories.rb +163 -0
- data/tests/test_keylog_panel.rb +261 -0
- data/tests/test_line_ends.rb +51 -0
- data/tests/test_line_tree.rb +86 -0
- data/tests/test_lsp_clangd.rb +281 -0
- data/tests/test_lsp_jump.rb +87 -0
- data/tests/test_lsp_position_encoding.rb +49 -0
- data/tests/test_lsp_symbols.rb +68 -0
- data/tests/test_macro.rb +137 -0
- data/tests/test_markdown_highlight.rb +57 -0
- data/tests/test_mode_badge.rb +41 -0
- data/tests/test_module_interface.rb +9 -9
- data/tests/test_notepad_bindings.rb +67 -0
- data/tests/test_perf_startup.rb +28 -0
- data/tests/test_popup_queue.rb +51 -0
- data/tests/test_random_edit.rb +109 -0
- data/tests/test_registers.rb +122 -0
- data/tests/test_revert.rb +127 -0
- data/tests/test_run_ruby.rb +77 -0
- data/tests/test_startup_file.rb +58 -0
- data/tests/test_status_area.rb +50 -0
- data/tests/test_text_objects.rb +163 -0
- data/tests/test_text_transforms.rb +341 -0
- data/tests/test_tmp_user_dir.rb +79 -0
- data/tests/test_tts.rb +68 -0
- data/tests/test_undo.rb +34 -34
- data/tests/test_user_dirs.rb +122 -0
- data/tests/test_vim_bindings.rb +353 -0
- data/tests/test_vim_conflicts.rb +100 -0
- data/tests/test_vim_operators.rb +116 -0
- data/tests/test_window_layout.rb +302 -0
- data/vimamsa.gemspec +3 -1
- data/vm_guest_run.sh +129 -0
- metadata +167 -10
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c40414938b976087d5c008f0881257ccf752091dd16d156bf7e21f8e9810839a
|
|
4
|
+
data.tar.gz: 5d8d17f66562cf4a4e4fadd4129d734841f10ad31f61ac56ae469f79c0647305
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 74a41608b496082f6fc49e462567d25fdd5783d27362a79d12f07bd02da7a7b7c3b764adc809650b19adea07a1bfcb915f0dcb3645ee19c0b0a41c42ce1ba44f
|
|
7
|
+
data.tar.gz: 59b3151ff41d232f015388579ba5d41a933349eafc451f2e2d74217f1c558b5f9a694bc1a12ffe4676b9cb896bae24f8edca71d07ac89151657edf45d727c306
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
# Builds the AppImage on GitHub's runners (scripts/appimage, doc/bundling_plan.md).
|
|
2
|
+
# - Push a tag vX.Y.Z (matching lib/vimamsa/version.rb): build, test on a clean
|
|
3
|
+
# Ubuntu, sign a build provenance attestation and attach the AppImage to the
|
|
4
|
+
# GitHub release for that tag.
|
|
5
|
+
# - Run it by hand (Actions ▸ AppImage ▸ Run workflow): build and test only;
|
|
6
|
+
# the AppImage is kept as a workflow artifact.
|
|
7
|
+
name: AppImage
|
|
8
|
+
|
|
9
|
+
on:
|
|
10
|
+
push:
|
|
11
|
+
tags: ["v*"]
|
|
12
|
+
workflow_dispatch:
|
|
13
|
+
|
|
14
|
+
permissions:
|
|
15
|
+
contents: write # create the release and upload the file
|
|
16
|
+
id-token: write # sign the attestation
|
|
17
|
+
attestations: write
|
|
18
|
+
|
|
19
|
+
jobs:
|
|
20
|
+
appimage:
|
|
21
|
+
runs-on: ubuntu-24.04
|
|
22
|
+
timeout-minutes: 60
|
|
23
|
+
steps:
|
|
24
|
+
- uses: actions/checkout@v4
|
|
25
|
+
with:
|
|
26
|
+
fetch-depth: 0 # the build clones this checkout; avoid a shallow source
|
|
27
|
+
|
|
28
|
+
- name: Check the tag matches the version
|
|
29
|
+
if: github.ref_type == 'tag'
|
|
30
|
+
run: |
|
|
31
|
+
v=$(ruby -Ilib -e 'require "vimamsa/version"; print Vimamsa::VERSION')
|
|
32
|
+
if [ "v$v" != "$GITHUB_REF_NAME" ]; then
|
|
33
|
+
echo "::error::tag $GITHUB_REF_NAME but lib/vimamsa/version.rb says $v"
|
|
34
|
+
exit 1
|
|
35
|
+
fi
|
|
36
|
+
|
|
37
|
+
# The compiled Ruby and the pinned appimagetool/runtime (all checked by
|
|
38
|
+
# the build script); gems and libraries are always built fresh
|
|
39
|
+
- uses: actions/cache@v4
|
|
40
|
+
with:
|
|
41
|
+
path: build/appimage/cache
|
|
42
|
+
key: appimage-cache-${{ hashFiles('scripts/appimage/Dockerfile', 'scripts/appimage/build_in_container.sh') }}
|
|
43
|
+
|
|
44
|
+
- name: Build
|
|
45
|
+
run: scripts/appimage/build.sh
|
|
46
|
+
|
|
47
|
+
- name: Test on a clean Ubuntu 24.04
|
|
48
|
+
run: scripts/appimage/smoke_test.sh build/appimage/Vimamsa-*-x86_64.AppImage
|
|
49
|
+
|
|
50
|
+
# One file name for every release, so the README can link to
|
|
51
|
+
# releases/latest/download/Vimamsa-x86_64.AppImage
|
|
52
|
+
- name: Name the file
|
|
53
|
+
run: |
|
|
54
|
+
mkdir -p dist
|
|
55
|
+
cp build/appimage/Vimamsa-*-x86_64.AppImage dist/Vimamsa-x86_64.AppImage
|
|
56
|
+
(cd dist && sha256sum Vimamsa-x86_64.AppImage > Vimamsa-x86_64.AppImage.sha256)
|
|
57
|
+
|
|
58
|
+
- name: Attest build provenance
|
|
59
|
+
if: github.ref_type == 'tag'
|
|
60
|
+
uses: actions/attest-build-provenance@v2
|
|
61
|
+
with:
|
|
62
|
+
subject-path: dist/Vimamsa-x86_64.AppImage
|
|
63
|
+
|
|
64
|
+
- name: Attach to the release
|
|
65
|
+
if: github.ref_type == 'tag'
|
|
66
|
+
env:
|
|
67
|
+
GH_TOKEN: ${{ github.token }}
|
|
68
|
+
run: |
|
|
69
|
+
notes="Download \`Vimamsa-x86_64.AppImage\`, make it executable and run it:
|
|
70
|
+
|
|
71
|
+
\`\`\`
|
|
72
|
+
chmod +x Vimamsa-x86_64.AppImage
|
|
73
|
+
./Vimamsa-x86_64.AppImage
|
|
74
|
+
\`\`\`
|
|
75
|
+
|
|
76
|
+
Needs x86_64 Linux with glibc 2.39 or newer (Ubuntu 24.04, Fedora 40, Debian 13 or newer).
|
|
77
|
+
|
|
78
|
+
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\`"
|
|
80
|
+
if gh release view "$GITHUB_REF_NAME" >/dev/null 2>&1; then
|
|
81
|
+
gh release upload "$GITHUB_REF_NAME" dist/* --clobber
|
|
82
|
+
else
|
|
83
|
+
gh release create "$GITHUB_REF_NAME" dist/* --title "Vimamsa ${GITHUB_REF_NAME#v}" \
|
|
84
|
+
--notes "$notes" --generate-notes
|
|
85
|
+
fi
|
|
86
|
+
|
|
87
|
+
- name: Keep as a workflow artifact
|
|
88
|
+
if: github.ref_type != 'tag'
|
|
89
|
+
uses: actions/upload-artifact@v4
|
|
90
|
+
with:
|
|
91
|
+
name: Vimamsa-x86_64.AppImage
|
|
92
|
+
path: dist/
|
|
93
|
+
retention-days: 14
|
data/.gitignore
CHANGED
data/Dockerfile
CHANGED
|
@@ -36,10 +36,13 @@ RUN gem install bundler -v '~> 2.4'
|
|
|
36
36
|
|
|
37
37
|
RUN echo "alias ll='ls -ltrh'" >> ~/.bashrc
|
|
38
38
|
ARG CACHE_BUST=1
|
|
39
|
-
RUN git clone https://github.com/SamiSieranoja/vimamsa.git && cd vimamsa && gem build vimamsa.gemspec && gem install vimamsa
|
|
40
|
-
RUN cp /usr/local/bundle/gems/vimamsa-0.1.23/ext/vmaext/vmaext.so vimamsa/lib/
|
|
39
|
+
RUN git clone https://github.com/SamiSieranoja/vimamsa.git && cd vimamsa && gem build vimamsa.gemspec && gem install vimamsa-*.gem
|
|
41
40
|
|
|
42
|
-
|
|
43
|
-
|
|
41
|
+
# Tests should not depend on writing to these directories
|
|
42
|
+
RUN chmod a-w -R /usr/local/bundle/gems/vimamsa*
|
|
43
|
+
RUN chmod a-w -R vimamsa
|
|
44
|
+
|
|
45
|
+
CMD ["bash", "-c", "xvfb-run -a ruby /usr/local/bundle/gems/vimamsa-*/run_tests.rb /tmp/report00.txt"]
|
|
46
|
+
# CMD ["bash", "-c", "cd vimamsa && xvfb-run -a ruby run_tests.rb"]
|
|
44
47
|
|
|
45
48
|
|
data/README.md
CHANGED
|
@@ -4,27 +4,59 @@ Vi/Vim -inspired experimental GUI-oriented text editor written with Ruby and GTK
|
|
|
4
4
|
|
|
5
5
|
<!-- toc -->
|
|
6
6
|
|
|
7
|
-
- [
|
|
8
|
-
- [
|
|
7
|
+
- [Download (AppImage)](#download-appimage)
|
|
8
|
+
- [Install as a Ruby gem](#install-as-a-ruby-gem)
|
|
9
9
|
* [Other install options](#other-install-options)
|
|
10
10
|
- [Run](#run)
|
|
11
|
-
- [
|
|
11
|
+
- [Demo](#demo)
|
|
12
12
|
- [Key bindings](#key-bindings)
|
|
13
13
|
- [Current limitations](#current-limitations)
|
|
14
14
|
|
|
15
15
|
<!-- tocstop -->
|
|
16
16
|
|
|
17
|
-
##
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
## Download (AppImage)
|
|
18
|
+
|
|
19
|
+
The easiest way: one file, nothing to install (Ruby, GTK and everything else
|
|
20
|
+
the editor needs are inside it).
|
|
21
|
+
|
|
22
|
+
1. Download [Vimamsa-x86_64.AppImage](https://github.com/SamiSieranoja/vimamsa/releases/latest/download/Vimamsa-x86_64.AppImage)
|
|
23
|
+
(all versions: [Releases](https://github.com/SamiSieranoja/vimamsa/releases)).
|
|
24
|
+
2. Make it executable and run it:
|
|
25
|
+
```
|
|
26
|
+
chmod +x Vimamsa-x86_64.AppImage
|
|
27
|
+
./Vimamsa-x86_64.AppImage [file]
|
|
28
|
+
```
|
|
29
|
+
(or in the file manager: Properties ▸ "Allow executing file as program", then
|
|
30
|
+
double-click it).
|
|
31
|
+
|
|
32
|
+
On the first start it adds Vimamsa to the application menu. If you move the
|
|
33
|
+
file, start it once from the new place to update the menu entry. To update, download the new
|
|
34
|
+
version over the old file.
|
|
35
|
+
|
|
36
|
+
Requirements: x86_64 Linux with glibc 2.39 or newer: Ubuntu 24.04, Linux Mint 22,
|
|
37
|
+
Fedora 40, Debian 13, Arch, openSUSE Tumbleweed or newer. On an older system it
|
|
38
|
+
stops at start with `GLIBC_2.39 not found`; use the gem install below instead.
|
|
39
|
+
If your home directory is mounted `noexec`, move the file to a place where programs
|
|
40
|
+
can run.
|
|
41
|
+
|
|
42
|
+
The AppImage is built by [GitHub Actions](.github/workflows/appimage.yml) from the
|
|
43
|
+
tagged source. To check that a downloaded file came from this repository's build
|
|
44
|
+
(needs the [GitHub CLI](https://cli.github.com/)):
|
|
45
|
+
```
|
|
46
|
+
gh attestation verify Vimamsa-x86_64.AppImage --repo SamiSieranoja/vimamsa
|
|
47
|
+
```
|
|
21
48
|
|
|
22
|
-
##
|
|
49
|
+
## Install as a Ruby gem
|
|
23
50
|
|
|
51
|
+
Requirements:
|
|
52
|
+
- Ruby 3.2+
|
|
53
|
+
- GTK 4
|
|
24
54
|
|
|
25
|
-
On Ubuntu (
|
|
55
|
+
On Ubuntu (24.04):
|
|
26
56
|
```
|
|
27
|
-
sudo apt install ruby-dev build-essential
|
|
57
|
+
sudo apt install ruby-dev build-essential pkg-config \
|
|
58
|
+
libgtk-4-dev libgtksourceview-5-dev libvte-2.91-gtk4-dev \
|
|
59
|
+
libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev
|
|
28
60
|
sudo gem install vimamsa
|
|
29
61
|
```
|
|
30
62
|
|
|
@@ -45,10 +77,6 @@ sudo gem install --local vimamsa-0.1.*.gem
|
|
|
45
77
|
|
|
46
78
|
```
|
|
47
79
|
|
|
48
|
-
Older version for GTK3:
|
|
49
|
-
|
|
50
|
-
sudo gem install vimamsa -v 0.1.10
|
|
51
|
-
|
|
52
80
|
## Run
|
|
53
81
|
```
|
|
54
82
|
vimamsa
|
|
@@ -59,106 +87,171 @@ Install packages for optional features:
|
|
|
59
87
|
sudo apt install ack-grep clang-format
|
|
60
88
|
```
|
|
61
89
|
|
|
62
|
-
For customization, edit ~/.vimamsa/custom.rb
|
|
90
|
+
For customization, edit ~/.config/vimamsa/custom.rb (Settings ▸ Customize).
|
|
63
91
|
|
|
64
|
-
|
|
92
|
+
Vimamsa keeps the files you edit (custom.rb, settings.rb, styles, bookmarks,
|
|
93
|
+
named macros) in ~/.config/vimamsa, and the files it generates (session,
|
|
94
|
+
histories, file index, backups, crash reports) in ~/.local/share/vimamsa
|
|
95
|
+
(`$XDG_CONFIG_HOME` / `$XDG_DATA_HOME` if set). `--user-dir DIR` puts both in
|
|
96
|
+
DIR. Files of older versions in ~/.vimamsa or ~/.config/vimamsa are moved to
|
|
97
|
+
their new places at the first start.
|
|
65
98
|
|
|
66
|
-
|
|
67
|
-
|
|
99
|
+
## Demo
|
|
100
|
+
|
|
101
|
+
[<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)
|
|
102
|
+
|
|
103
|
+
Moving with `h j k l` and `w e b`, `y y p`, `d d`, undo `u` / redo `ctrl-r`,
|
|
104
|
+
typing in Insert mode and back to Command mode with `ctrl` (press and release
|
|
105
|
+
it alone), selecting in Visual mode, and easy jump (`s`: type a word's label to
|
|
106
|
+
jump there). The key log panel on the right (View ▸ Toggle
|
|
107
|
+
key log panel) shows each key and the action it ran.
|
|
108
|
+
|
|
109
|
+
The editor plays this demo and others itself: the introduction page (shown on
|
|
110
|
+
the first start, and from Help ▸ Introduction) has a button for each. It also
|
|
111
|
+
links to a one-screen summary for Vim users (Help ▸ Vimamsa for Vim users).
|
|
112
|
+
`vimamsa --intro` shows the introduction page at start whatever the settings
|
|
113
|
+
say.
|
|
68
114
|
|
|
69
115
|
## Key bindings
|
|
70
116
|
|
|
71
|
-
|
|
117
|
+
The default keybinding scheme, "vimlike", is close to Vim. It keeps the Vim
|
|
118
|
+
bindings and changes a few keys for its own features. For the full list, see
|
|
119
|
+
the menu item "Help ▸ Show key bindings" and the file
|
|
120
|
+
lib/vimamsa/key_bindings_vimlike.rb. You can switch the scheme in Settings
|
|
121
|
+
("Keybinding scheme", applied after a restart) or with
|
|
122
|
+
`cnf.keybindings.scheme = "vim"` in ~/.config/vimamsa/settings.rb:
|
|
72
123
|
|
|
73
|
-
|
|
124
|
+
- `vimlike` (default): Vim keys plus the extra bindings below
|
|
125
|
+
- `vim`: plain Vim bindings
|
|
126
|
+
- `notepad`: non-modal, stays in insert mode (gedit/notepad style)
|
|
74
127
|
|
|
75
|
-
|
|
128
|
+
Keys that work much like in Vim:
|
|
129
|
+
|
|
130
|
+
In Command mode:
|
|
76
131
|
```
|
|
77
|
-
j k l
|
|
78
|
-
|
|
132
|
+
h j k l w b e W B E 0 ^ $ gg G <count>G f F t T ; * / n N : gf g;
|
|
133
|
+
i a A I o J p P D Y S u ctrl-r . x ~ r<char> R v m<char> '<char> `<char>
|
|
134
|
+
q<char> @<char> "<char> ctrl-f ctrl-b ctrl-d ctrl-u ctrl-a
|
|
79
135
|
```
|
|
136
|
+
Operators `d c y gU gu g~ > <` combine with the motions above and with text
|
|
137
|
+
objects (`iw aw i( a" it ...`), e.g. `d w`, `c i w`, `y y`, `> >`.
|
|
80
138
|
|
|
81
139
|
In Visual mode:
|
|
82
140
|
```
|
|
83
|
-
d y gU gu
|
|
141
|
+
d x y c J u U ~ gU gu > < iw aw ...
|
|
84
142
|
```
|
|
85
143
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
- ctrl
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
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
|
-
|
|
144
|
+
The keys that work differently from Vim are listed in the tables below
|
|
145
|
+
(the full list of conflicts is in doc/vimlike_vim_conflicts.md).
|
|
146
|
+
|
|
147
|
+
Syntax:
|
|
148
|
+
|
|
149
|
+
- `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.
|
|
150
|
+
- `ctrl-x` means press and hold the ctrl key, press x.
|
|
151
|
+
- `, a` means press `,`, then `a`.
|
|
152
|
+
|
|
153
|
+
**Command mode**
|
|
154
|
+
|
|
155
|
+
| Key | Action |
|
|
156
|
+
|---|---|
|
|
157
|
+
| `ctrl!` | Switch between command and insert modes |
|
|
158
|
+
| `shift!` `s` | Save file (press and release shift, then `s`) |
|
|
159
|
+
| `s` | Easy jump (similar to Vim [EasyMotion](https://github.com/easymotion/vim-easymotion)): type a word's label to jump there |
|
|
160
|
+
| `z` | Enter BROWSE mode |
|
|
161
|
+
| `O` | Move to end of line |
|
|
162
|
+
| `X` | Insert an empty line below |
|
|
163
|
+
| `C` | Search in files (grep) |
|
|
164
|
+
| `tab` | Switch between current and previous buffer |
|
|
165
|
+
| `M` | Run the last recorded macro |
|
|
166
|
+
| `enter` | On a link: open url in browser. On `/path/to/file.txt:linenum`: open the file, jump to linenum |
|
|
167
|
+
| `space <char>` | Insert character `<char>` |
|
|
168
|
+
| `ctrl-o` | Open file |
|
|
169
|
+
| `ctrl-s` | Save file |
|
|
170
|
+
| `ctrl-w` | Close buffer |
|
|
171
|
+
| `ctrl-c` / `ctrl-x` | Comment / uncomment line |
|
|
172
|
+
| `ctrl-q` | Quit |
|
|
173
|
+
| `g s` | Jump to a file in the file panel by its label |
|
|
174
|
+
| `alt-h` / `alt-l` | Previous / next file in the file panel |
|
|
175
|
+
| `, b` | Switch buffer (buffer manager) |
|
|
176
|
+
| `, f` | File explorer: browse directories (`h` parent directory, `l` or `enter` open) |
|
|
177
|
+
| `, , f` or `, z` | File finder (fuzzy search for file names) |
|
|
178
|
+
| `, h` | File history |
|
|
179
|
+
| `, g` | Search for a string in the current buffer, show matching lines |
|
|
180
|
+
| `, a` | Search in files using ack |
|
|
181
|
+
| `, r r` | Search and replace |
|
|
182
|
+
| `, e` or `:` | Command line |
|
|
183
|
+
| `, s a` | Save as |
|
|
184
|
+
| `, n b` | New buffer |
|
|
185
|
+
| `, c b` | Close buffer |
|
|
186
|
+
| `, r v b` | Revert buffer from disk |
|
|
187
|
+
| `, M` / `, '` | Add bookmark / list bookmarks |
|
|
188
|
+
| `, v` | Auto-indent buffer |
|
|
189
|
+
| `, w` | Switch between columns |
|
|
190
|
+
| `, , w` | Toggle two-column view |
|
|
191
|
+
| `, m h` | Show messages |
|
|
192
|
+
|
|
193
|
+
**Insert mode** (similar to bash or emacs)
|
|
194
|
+
|
|
195
|
+
| Key | Action |
|
|
196
|
+
|---|---|
|
|
197
|
+
| `ctrl!` or `esc` | Switch to command mode |
|
|
198
|
+
| `ctrl-n` / `ctrl-p` | Move to next / previous line |
|
|
199
|
+
| `ctrl-a` / `ctrl-e` | Move to beginning / end of line |
|
|
200
|
+
| `ctrl-b` / `ctrl-f` | Move backward / forward one char |
|
|
201
|
+
| `alt-b` / `alt-f` | Move backward / forward one word |
|
|
202
|
+
| `ctrl-d` | Delete to end of word |
|
|
203
|
+
| `ctrl-z` / `ctrl-y` | Undo / redo |
|
|
204
|
+
| `ctrl-c` / `ctrl-x` / `ctrl-v` | Copy / cut / paste |
|
|
205
|
+
| `shift-<arrow>` | Select |
|
|
206
|
+
| `ctrl-l` / `ctrl-g` | Search in buffer / next match |
|
|
207
|
+
| `ctrl-space` or `ctrl-h` | Show completions (`tab` / `shift-tab` to choose, `shift!` to accept) |
|
|
208
|
+
| `alt-s` | Easy jump |
|
|
209
|
+
| `ctrl-s` | Save file |
|
|
210
|
+
|
|
211
|
+
**Visual mode**
|
|
212
|
+
|
|
213
|
+
| Key | Action |
|
|
214
|
+
|---|---|
|
|
215
|
+
| `ctrl!` or `esc` | Exit visual mode |
|
|
216
|
+
| `s` | Easy jump: extend the selection to a word's label |
|
|
217
|
+
| `tab` / `shift-tab` | Indent / unindent selection |
|
|
218
|
+
| `ctrl-c` / `ctrl-x` | Comment / uncomment selection |
|
|
219
|
+
| `a y` / `a d` | Copy / delete, appending to the clipboard |
|
|
220
|
+
| `g c` / `g s` | Capitalize / swap case |
|
|
221
|
+
| `g r` | Reverse selection |
|
|
222
|
+
| `g w` | Remove extra spaces |
|
|
223
|
+
| `, t b` / `, t i` / `, t l` | Bold / italic / link (hyperplaintext) |
|
|
224
|
+
|
|
225
|
+
**Browse mode** (enter with `z`)
|
|
226
|
+
|
|
227
|
+
| Key | Action |
|
|
228
|
+
|---|---|
|
|
229
|
+
| `h` / `l` | Previous / next buffer in history |
|
|
230
|
+
| `q` / `w` | Previous / next edited position |
|
|
231
|
+
| `p` / `n` | Previous / next file in the file panel |
|
|
232
|
+
| `s` / `d` | Page up / down |
|
|
233
|
+
| `e` / `r` | Quarter page up / down |
|
|
234
|
+
| `i` / `o` | Start / end of buffer |
|
|
235
|
+
| `z` | Center the current line, back to command mode |
|
|
236
|
+
| `m` | Run the last recorded macro |
|
|
237
|
+
| `c` | Close buffer |
|
|
238
|
+
| `j`, `esc`, `enter` or `ctrl!` | Back to command mode |
|
|
239
|
+
|
|
240
|
+
Bindings can be customized in ~/.config/vimamsa/custom.rb.
|
|
241
|
+
For example, to bind ctrl-n to action "create new file":
|
|
242
|
+
```
|
|
243
|
+
bindkey 'C ctrl-n', 'buf.new'
|
|
244
|
+
```
|
|
157
245
|
|
|
158
|
-
|
|
159
|
-
|
|
246
|
+
custom.rb is loaded in two phases. The body of the file runs early, before
|
|
247
|
+
modules are initialized, so that the settings it makes (cnf.\*) are visible to
|
|
248
|
+
them. Modes that are created by modules (e.g. "fexp" for the file selector,
|
|
249
|
+
"grep") do not exist yet at that point; bindings for those go in an optional
|
|
250
|
+
function `hook_custom_after_init`, which is called after everything is loaded:
|
|
160
251
|
```
|
|
161
|
-
|
|
252
|
+
def hook_custom_after_init
|
|
253
|
+
bindkey 'fexp , x', :my_action
|
|
254
|
+
end
|
|
162
255
|
```
|
|
163
256
|
|
|
164
257
|
|
|
@@ -166,7 +259,10 @@ bindkey 'C ctrl-n', 'create_new_file()'
|
|
|
166
259
|
- Cursor sometimes vanishes when dragging or resizing the window. At least some cases are fixed in new GTK4 versions ( >= 4.18, in Ubuntu Ubuntu 25.04). Workaround is to press ctrl key twice.
|
|
167
260
|
|
|
168
261
|
## Current limitations
|
|
169
|
-
-
|
|
262
|
+
- Linux only
|
|
263
|
+
|
|
264
|
+
Mainly tested with:
|
|
265
|
+
- UTF8, English or Finnish
|
|
170
266
|
- Line endings with "\n"
|
|
171
267
|
|
|
172
268
|
|
data/custom_example.rb
CHANGED
|
@@ -9,7 +9,15 @@
|
|
|
9
9
|
# syntax: bindkey "mode key1 key2 ..."
|
|
10
10
|
|
|
11
11
|
# Execute in new gnome-terminal tab
|
|
12
|
-
# bindkey "C , , t",
|
|
12
|
+
# bindkey "C , , t", "term.line"
|
|
13
|
+
|
|
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 , 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.
|
|
13
21
|
|
|
14
22
|
# setcnf :tab_width, 4
|
|
15
23
|
|
|
@@ -43,7 +51,7 @@ def collect_c_header()
|
|
|
43
51
|
buf.insert_txt(s)
|
|
44
52
|
end
|
|
45
53
|
|
|
46
|
-
reg_act(
|
|
54
|
+
reg_act("custom.c_header", proc { collect_c_header }, "Collect function definitions for c header file")
|
|
47
55
|
|
|
48
56
|
# Extract all numbers from txt selection
|
|
49
57
|
c = Converter.new(lambda { |x| x.scan(/([\+\-]?\d+(\.\d+)?)/).collect { |x| x[0] }.join(" ") }, :lambda, :getnums)
|
|
@@ -60,39 +68,73 @@ Curabitur pretium tincidunt lacus. Nulla gravida orci a odio. Nullam varius, tur
|
|
|
60
68
|
end
|
|
61
69
|
|
|
62
70
|
# Find with action search ([C] , , s)
|
|
63
|
-
reg_act(
|
|
71
|
+
reg_act("custom.lorem_ipsum", proc { insert_lorem_ipsum }, "Insert lorem ipsum")
|
|
64
72
|
|
|
65
73
|
def open_mtg(urlpref = nil)
|
|
66
74
|
require "uri"
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
url = "https://gatherer.wizards.com/Pages/Card/Details.aspx?name=#{u}"
|
|
74
|
-
if !urlpref.nil?
|
|
75
|
-
url = urlpref + u
|
|
76
|
-
end
|
|
77
|
-
open_url(url)
|
|
75
|
+
cardname = if vma.buf.visual_mode?
|
|
76
|
+
vma.buf.get_current_selection.strip
|
|
77
|
+
else
|
|
78
|
+
l = vma.buf.get_current_line.strip
|
|
79
|
+
m = l.match(/(\w[\w\'\-\s]+)/)
|
|
80
|
+
m ? m[0].strip : nil
|
|
78
81
|
end
|
|
82
|
+
return if cardname.nil? || cardname.empty?
|
|
83
|
+
u = URI.encode_www_form_component(cardname)
|
|
84
|
+
url = urlpref ? urlpref + u : "https://gatherer.wizards.com/Pages/Card/Details.aspx?name=#{u}"
|
|
85
|
+
open_url(url)
|
|
79
86
|
end
|
|
80
87
|
|
|
81
|
-
# reg_act(
|
|
82
|
-
# bindkey "
|
|
88
|
+
# reg_act("custom.mtg", proc { open_mtg }, "open mtg card info")
|
|
89
|
+
# bindkey "VC , , m", "custom.mtg"
|
|
90
|
+
# Try on this line:
|
|
83
91
|
# Restless Cottage
|
|
84
|
-
|
|
92
|
+
|
|
93
|
+
# The introduction page (Help ▸ Introduction) is shown at start once. To show
|
|
94
|
+
# it at every start:
|
|
95
|
+
# cnf.intro.show_on_startup = true
|
|
85
96
|
|
|
86
97
|
# Primitive support for LSP (not well tested)
|
|
87
98
|
# To enable LSP:
|
|
88
99
|
# cnf.lsp.enabled = true
|
|
100
|
+
|
|
101
|
+
# solargraph (Ruby):
|
|
89
102
|
# cnf.lsp.server.solargraph = { name: "solargraph", command: "solargraph stdio", type: "stdio" }
|
|
90
103
|
# cnf.lsp.server.solargraph.languages = ["ruby"]
|
|
91
104
|
|
|
105
|
+
# ruby-lsp (Ruby):
|
|
106
|
+
# cnf.lsp.server.ruby_lsp = { name: "ruby-lsp", command: "bundle exec ruby-lsp", type: "stdio" }
|
|
107
|
+
# cnf.lsp.server.ruby_lsp.languages = ["ruby"]
|
|
108
|
+
|
|
109
|
+
|
|
92
110
|
# cnf.lsp.server.clangd = { name: "clangd", command: "clangd-12 --offset-encoding=utf-8", type: "stdio" }
|
|
93
111
|
# cnf.lsp.server.clangd.languages = ["c", "cpp"]
|
|
94
112
|
|
|
113
|
+
# Autocomplete (word completion popup in insert mode). Disabled by default.
|
|
114
|
+
# Candidates come from words in open buffers, plus the LSP server when
|
|
115
|
+
# cnf.lsp.enabled and a server is configured for the file's language.
|
|
116
|
+
# Enable it and (optionally) tune the defaults shown:
|
|
117
|
+
# cnf.autocomplete.enabled = true
|
|
118
|
+
# cnf.autocomplete.auto_trigger = true # popup while typing (false: ctrl-space/ctrl-h only)
|
|
119
|
+
# cnf.autocomplete.min_chars = 2 # typed chars before the popup opens
|
|
120
|
+
# cnf.autocomplete.max_items = 50 # candidates kept in the list
|
|
121
|
+
# cnf.autocomplete.visible_items = 10 # popup rows before scrolling
|
|
122
|
+
# cnf.autocomplete.lsp.enabled = true
|
|
123
|
+
# cnf.autocomplete.lsp.debounce = 0.15 # seconds before asking the server
|
|
124
|
+
|
|
95
125
|
# Uncomment this if you don't want to see the state trail of previous action
|
|
96
126
|
# on top right corner:
|
|
97
127
|
# cnf.kbd.show_prev_action = false
|
|
98
128
|
|
|
129
|
+
# Add comment character rule for a file type not detected automatically:
|
|
130
|
+
# cnf.comment_chars! << { pattern: /\.lua$/, char: "--" }
|
|
131
|
+
|
|
132
|
+
# Second phase of this file. Everything above runs early during startup, before
|
|
133
|
+
# the file selector, grep and the modules are initialized, so that the cnf.*
|
|
134
|
+
# settings above are visible to them. Their keyboard modes (e.g. "fexp" for the
|
|
135
|
+
# file selector, "grep") do not exist yet at that point: bindings for those go
|
|
136
|
+
# here, in a function that is called after everything has been loaded.
|
|
137
|
+
# def hook_custom_after_init
|
|
138
|
+
# bindkey "fexp , x", "custom.my_file_action"
|
|
139
|
+
# end
|
|
140
|
+
|