vimamsa 0.1.26 → 0.1.27
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 +62 -16
- data/custom_example.rb +43 -13
- data/doc/TODO.md +461 -0
- data/doc/bundling_plan.md +569 -0
- data/doc/key_bindings_report_plan.md +168 -0
- data/doc/missing_vim_bindings.md +71 -0
- data/doc/modules_settings_plan.md +433 -0
- data/doc/refactor_dedup_plan.md +117 -0
- data/doc/unused_code_plan.md +120 -0
- data/doc/vim_compatibility_plan.md +296 -0
- data/doc/vimlike_vim_conflicts.md +254 -0
- data/doc/vm_snapshots_plan.md +146 -0
- data/exe/run_tests.rb +117 -3
- data/exe/vimamsa +24 -4
- data/fonts/OFL-Oxanium.txt +93 -0
- data/fonts/Oxanium[wght].ttf +0 -0
- data/icon.png +0 -0
- data/img/demo.gif +0 -0
- data/lang/hyperplaintext.lang +6 -0
- data/lib/vimamsa/ack.rb +11 -1
- data/lib/vimamsa/actions.rb +4 -1
- 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 +593 -82
- data/lib/vimamsa/buffer_changetext.rb +102 -42
- data/lib/vimamsa/buffer_cursor.rb +7 -0
- data/lib/vimamsa/buffer_list.rb +4 -0
- data/lib/vimamsa/buffer_manager.rb +4 -1
- data/lib/vimamsa/bundled_fonts.rb +32 -0
- data/lib/vimamsa/clipboard.rb +3 -0
- data/lib/vimamsa/conf.rb +59 -3
- data/lib/vimamsa/constants.rb +3 -0
- data/lib/vimamsa/crash_handler.rb +149 -0
- data/lib/vimamsa/debug.rb +4 -1
- data/lib/vimamsa/desktop_install.rb +96 -0
- data/lib/vimamsa/diff_buffer.rb +39 -10
- data/lib/vimamsa/easy_jump.rb +3 -0
- data/lib/vimamsa/editor.rb +263 -57
- data/lib/vimamsa/encrypt.rb +78 -29
- data/lib/vimamsa/file_finder.rb +4 -19
- data/lib/vimamsa/file_history.rb +3 -0
- data/lib/vimamsa/file_manager.rb +30 -15
- data/lib/vimamsa/fold.rb +226 -0
- data/lib/vimamsa/gui.rb +520 -106
- data/lib/vimamsa/gui_command_line.rb +208 -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 +59 -35
- data/lib/vimamsa/gui_func_panel.rb +67 -22
- data/lib/vimamsa/gui_image.rb +3 -0
- data/lib/vimamsa/gui_keylog_panel.rb +246 -0
- data/lib/vimamsa/gui_menu.rb +23 -11
- data/lib/vimamsa/gui_select_window.rb +19 -48
- data/lib/vimamsa/gui_settings.rb +78 -37
- data/lib/vimamsa/gui_sourceview.rb +273 -19
- data/lib/vimamsa/gui_sourceview_autocomplete.rb +319 -90
- data/lib/vimamsa/gui_text.rb +63 -2
- data/lib/vimamsa/gui_theme.rb +606 -0
- data/lib/vimamsa/hook.rb +3 -0
- data/lib/vimamsa/hyper_plain_text.rb +3 -0
- data/lib/vimamsa/key_actions.rb +112 -13
- data/lib/vimamsa/key_binding_tree.rb +242 -215
- data/lib/vimamsa/key_bindings_notepad.rb +43 -0
- data/lib/vimamsa/key_bindings_report.rb +261 -0
- data/lib/vimamsa/key_bindings_vim.rb +354 -0
- data/lib/vimamsa/key_bindings_vimlike.rb +65 -9
- data/lib/vimamsa/langservp.rb +271 -54
- data/lib/vimamsa/macro.rb +3 -0
- data/lib/vimamsa/main.rb +14 -8
- data/lib/vimamsa/rbvma.rb +26 -1
- data/lib/vimamsa/search.rb +3 -0
- data/lib/vimamsa/search_replace.rb +11 -10
- data/lib/vimamsa/string_util.rb +120 -40
- data/lib/vimamsa/terminal.rb +3 -0
- data/lib/vimamsa/test_framework.rb +28 -2
- data/lib/vimamsa/tests.rb +3 -0
- data/lib/vimamsa/text_objects.rb +353 -0
- data/lib/vimamsa/text_transforms.rb +14 -0
- data/lib/vimamsa/util.rb +46 -7
- data/lib/vimamsa/version.rb +1 -1
- data/lib/vimamsa.rb +0 -1
- 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/tts/tts.rb +119 -0
- data/modules/tts/tts_info.rb +3 -0
- data/run_e2e_vm.sh +28 -0
- data/run_tests_vm.sh +130 -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_steps.txt +59 -0
- data/scripts/demo/record_demo.rb +177 -0
- data/scripts/demo/shapes.rb +28 -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_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 +33 -3
- data/tests/test_bookmarks.rb +206 -0
- data/tests/test_bracket_match.rb +85 -0
- data/tests/test_bundling.rb +92 -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 +129 -0
- data/tests/test_copy_paste.rb +80 -0
- data/tests/test_crash_handler.rb +39 -0
- data/tests/test_custom_two_phase.rb +92 -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_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_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_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_jump_to_file.rb +41 -0
- data/tests/test_key_bindings.rb +208 -0
- data/tests/test_keylog_panel.rb +101 -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_notepad_bindings.rb +67 -0
- data/tests/test_popup_queue.rb +51 -0
- data/tests/test_random_edit.rb +109 -0
- data/tests/test_revert.rb +127 -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 +329 -0
- data/tests/test_tts.rb +68 -0
- data/tests/test_vim_bindings.rb +252 -0
- data/tests/test_vim_conflicts.rb +63 -0
- data/tests/test_window_layout.rb +219 -0
- data/vimamsa.gemspec +3 -1
- data/vm_guest_run.sh +109 -0
- metadata +112 -10
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 30dc038cb0e2f120cf8952d943f181a915d76627c4e9f788b5c1b5928b266229
|
|
4
|
+
data.tar.gz: b4c8cb93244fa18791cb85ffcbfd91949fd146b6afe498527d45777e7a11b5f8
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c6e79f3ffbe2b42638d1ad659dced6ff1924339b18090c278c2e96e220471857344d0a2777e484d8776a2c6acd56b1f9c73ebc829e56f1da3f88603bbe56df4e
|
|
7
|
+
data.tar.gz: 3ea0451e5d26c8439e92a6faa0e2d57868dbaa747126217c4a03c7069b94cf7304a9ebca7999a77e66439356b18c90fb139d88ef7beb8a1a66c0fa650270afd9
|
|
@@ -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,23 +4,53 @@ 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
|
-
|
|
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.
|
|
20
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.
|
|
21
41
|
|
|
22
|
-
|
|
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
|
+
```
|
|
23
48
|
|
|
49
|
+
## Install as a Ruby gem
|
|
50
|
+
|
|
51
|
+
Requirements:
|
|
52
|
+
- Ruby 3.1+
|
|
53
|
+
- GTK 4
|
|
24
54
|
|
|
25
55
|
On Ubuntu (22.04):
|
|
26
56
|
```
|
|
@@ -45,10 +75,6 @@ sudo gem install --local vimamsa-0.1.*.gem
|
|
|
45
75
|
|
|
46
76
|
```
|
|
47
77
|
|
|
48
|
-
Older version for GTK3:
|
|
49
|
-
|
|
50
|
-
sudo gem install vimamsa -v 0.1.10
|
|
51
|
-
|
|
52
78
|
## Run
|
|
53
79
|
```
|
|
54
80
|
vimamsa
|
|
@@ -61,10 +87,15 @@ sudo apt install ack-grep clang-format
|
|
|
61
87
|
|
|
62
88
|
For customization, edit ~/.vimamsa/custom.rb
|
|
63
89
|
|
|
64
|
-
##
|
|
90
|
+
## Demo
|
|
65
91
|
|
|
66
|
-
|
|
67
|
-
|
|
92
|
+

|
|
93
|
+
|
|
94
|
+
Moving with `h j k l` and `w e b`, `y y p`, `d d`, undo `u` / redo `ctrl-r`,
|
|
95
|
+
typing in Insert mode and back to Command mode with `ctrl` (press and release
|
|
96
|
+
it alone), selecting in Visual mode, and easy jump (`s`: type a word's label to
|
|
97
|
+
jump there). The key log panel on the right (View ▸ Toggle
|
|
98
|
+
key log panel) shows each key and the action it ran.
|
|
68
99
|
|
|
69
100
|
## Key bindings
|
|
70
101
|
|
|
@@ -155,10 +186,22 @@ Syntax:
|
|
|
155
186
|
</tbody>
|
|
156
187
|
</table>
|
|
157
188
|
|
|
158
|
-
Bindings can be customized in ~/.vimamsa/custom.rb
|
|
189
|
+
Bindings can be customized in ~/.config/vimamsa/custom.rb
|
|
159
190
|
For example, to bind ctrl-n to action "create new file":
|
|
160
191
|
```
|
|
161
192
|
bindkey 'C ctrl-n', 'create_new_file()'
|
|
193
|
+
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
custom.rb is loaded in two phases. The body of the file runs early, before
|
|
197
|
+
modules are initialized, so that the settings it makes (cnf.\*) are visible to
|
|
198
|
+
them. Modes that are created by modules (e.g. "fexp" for the file selector,
|
|
199
|
+
"grep") do not exist yet at that point; bindings for those go in an optional
|
|
200
|
+
function `hook_custom_after_init`, which is called after everything is loaded:
|
|
201
|
+
```
|
|
202
|
+
def hook_custom_after_init
|
|
203
|
+
bindkey 'fexp , x', :my_action
|
|
204
|
+
end
|
|
162
205
|
```
|
|
163
206
|
|
|
164
207
|
|
|
@@ -166,7 +209,10 @@ bindkey 'C ctrl-n', 'create_new_file()'
|
|
|
166
209
|
- 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
210
|
|
|
168
211
|
## Current limitations
|
|
169
|
-
-
|
|
212
|
+
- Linux only
|
|
213
|
+
|
|
214
|
+
Mainly tested with:
|
|
215
|
+
- UTF8, English or Finnish
|
|
170
216
|
- Line endings with "\n"
|
|
171
217
|
|
|
172
218
|
|
data/custom_example.rb
CHANGED
|
@@ -64,35 +64,65 @@ reg_act(:insert_lorem_ipsum, proc { insert_lorem_ipsum }, "Insert lorem ipsum")
|
|
|
64
64
|
|
|
65
65
|
def open_mtg(urlpref = nil)
|
|
66
66
|
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)
|
|
67
|
+
cardname = if vma.buf.visual_mode?
|
|
68
|
+
vma.buf.get_current_selection.strip
|
|
69
|
+
else
|
|
70
|
+
l = vma.buf.get_current_line.strip
|
|
71
|
+
m = l.match(/(\w[\w\'\-\s]+)/)
|
|
72
|
+
m ? m[0].strip : nil
|
|
78
73
|
end
|
|
74
|
+
return if cardname.nil? || cardname.empty?
|
|
75
|
+
u = URI.encode_www_form_component(cardname)
|
|
76
|
+
url = urlpref ? urlpref + u : "https://gatherer.wizards.com/Pages/Card/Details.aspx?name=#{u}"
|
|
77
|
+
open_url(url)
|
|
79
78
|
end
|
|
80
79
|
|
|
81
80
|
# reg_act(:open_mtg, proc { open_mtg }, "open mtg card info")
|
|
82
|
-
# bindkey "
|
|
81
|
+
# bindkey "VC , , m", :open_mtg
|
|
82
|
+
# Try on this line:
|
|
83
83
|
# Restless Cottage
|
|
84
|
-
# https://duckduckgo.com/?ia=web&origin=funnel_home_website&t=h_&q=
|
|
85
84
|
|
|
86
85
|
# Primitive support for LSP (not well tested)
|
|
87
86
|
# To enable LSP:
|
|
88
87
|
# cnf.lsp.enabled = true
|
|
88
|
+
|
|
89
|
+
# solargraph (Ruby):
|
|
89
90
|
# cnf.lsp.server.solargraph = { name: "solargraph", command: "solargraph stdio", type: "stdio" }
|
|
90
91
|
# cnf.lsp.server.solargraph.languages = ["ruby"]
|
|
91
92
|
|
|
93
|
+
# ruby-lsp (Ruby):
|
|
94
|
+
# cnf.lsp.server.ruby_lsp = { name: "ruby-lsp", command: "bundle exec ruby-lsp", type: "stdio" }
|
|
95
|
+
# cnf.lsp.server.ruby_lsp.languages = ["ruby"]
|
|
96
|
+
|
|
97
|
+
|
|
92
98
|
# cnf.lsp.server.clangd = { name: "clangd", command: "clangd-12 --offset-encoding=utf-8", type: "stdio" }
|
|
93
99
|
# cnf.lsp.server.clangd.languages = ["c", "cpp"]
|
|
94
100
|
|
|
101
|
+
# Autocomplete (word completion popup in insert mode). Disabled by default.
|
|
102
|
+
# Candidates come from words in open buffers, plus the LSP server when
|
|
103
|
+
# cnf.lsp.enabled and a server is configured for the file's language.
|
|
104
|
+
# Enable it and (optionally) tune the defaults shown:
|
|
105
|
+
# cnf.autocomplete.enabled = true
|
|
106
|
+
# cnf.autocomplete.auto_trigger = true # popup while typing (false: ctrl-space/ctrl-h only)
|
|
107
|
+
# cnf.autocomplete.min_chars = 2 # typed chars before the popup opens
|
|
108
|
+
# cnf.autocomplete.max_items = 50 # candidates kept in the list
|
|
109
|
+
# cnf.autocomplete.visible_items = 10 # popup rows before scrolling
|
|
110
|
+
# cnf.autocomplete.lsp.enabled = true
|
|
111
|
+
# cnf.autocomplete.lsp.debounce = 0.15 # seconds before asking the server
|
|
112
|
+
|
|
95
113
|
# Uncomment this if you don't want to see the state trail of previous action
|
|
96
114
|
# on top right corner:
|
|
97
115
|
# cnf.kbd.show_prev_action = false
|
|
98
116
|
|
|
117
|
+
# Add comment character rule for a file type not detected automatically:
|
|
118
|
+
# cnf.comment_chars! << { pattern: /\.lua$/, char: "--" }
|
|
119
|
+
|
|
120
|
+
# Second phase of this file. Everything above runs early during startup, before
|
|
121
|
+
# the file selector, grep and the modules are initialized, so that the cnf.*
|
|
122
|
+
# settings above are visible to them. Their keyboard modes (e.g. "fexp" for the
|
|
123
|
+
# file selector, "grep") do not exist yet at that point: bindings for those go
|
|
124
|
+
# here, in a function that is called after everything has been loaded.
|
|
125
|
+
# def hook_custom_after_init
|
|
126
|
+
# bindkey "fexp , x", :my_file_action
|
|
127
|
+
# end
|
|
128
|
+
|