lambdalisue / vim-initial

🅰️ Yet another jump-assistant plugin for Vim/Neovim powered by Denops.
MIT License
10 stars 0 forks source link
vim-denops

🅰️ Initial

Test codecov MIT License

CleanShot 2024-11-20 at 21 40 49

Initial (vim-initial) is yet another jump-assistant plugin for Vim/Neovim powered by Denops.

This plugin restricts matching targets to the initial characters of words, reducing the number of candidates for filtering. The design is based on the hypothesis that when users want to jump to a specific location on the screen, they often focus on the initial characters of words. Thanks to this approach, after triggering the plugin, users can jump to their desired location by typing an average of 2–3 keys (excluding the key used to invoke the plugin).

[!WARNING] This plugin is still in the early stages of development. Its practicality and value for users are yet to be determined, and future maintenance depends on its reception.

Requirements

Users must have Deno installed to use this plugin.

Installation

To install Denops and this plugin using a plugin manager such as vim-plug, add the following lines to your Vim configuration:

Plug 'vim-denops/denops.vim'
Plug 'lambdalisue/vim-initial'

Usage

First, define a normal mode mapping to invoke the Initial command, for example:

nnoremap t <Cmd>Initial<CR>

Then, type t to invoke the Initial command.

When the Initial command is invoked, the plugin enters the Initial Character Input Mode. In this mode, users type the initial character of the desired word, transitioning to the Label Jump Mode. In Label Jump Mode, labels are assigned to words whose initial character matches the input. Typing the label will jump to the target location.

If the target count is zero or one during the Initial Character Input Mode, the plugin will automatically cancel or jump without transitioning to the Label Jump Mode.

To modify the number of initial characters to match, use the -length={number} argument with the Initial command. For example:

nnoremap t <Cmd>Initial -length=3<CR>

Acknowledgments

This plugin is heavily inspired by fuzzy-motion.vim. While Initial imposes stricter constraints, such as limiting matches to word initials, many usability ideas are derived from fuzzy-motion.vim.

License

The code in this repository is licensed under the MIT License, as described in LICENSE. Contributors agree that any modifications submitted to this repository are also licensed under the same terms.