mirror of
https://github.com/nix-community/nixvim.git
synced 2025-11-08 19:46:06 +01:00
plugins/hop: cleanup, remove some settings declarations
Signed-off-by: saygo-png <saygo.mail@proton.me>
This commit is contained in:
parent
0420aa712f
commit
281f36c9af
1 changed files with 4 additions and 178 deletions
|
|
@ -1,14 +1,12 @@
|
||||||
{
|
{
|
||||||
lib,
|
lib,
|
||||||
helpers,
|
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
with lib;
|
|
||||||
lib.nixvim.plugins.mkNeovimPlugin {
|
lib.nixvim.plugins.mkNeovimPlugin {
|
||||||
name = "hop";
|
name = "hop";
|
||||||
package = "hop-nvim";
|
package = "hop-nvim";
|
||||||
|
|
||||||
maintainers = [ maintainers.GaetanLepage ];
|
maintainers = [ lib.maintainers.GaetanLepage ];
|
||||||
|
|
||||||
description = ''
|
description = ''
|
||||||
A plugin allowing you to jump anywhere in a document with as few keystrokes as possible.
|
A plugin allowing you to jump anywhere in a document with as few keystrokes as possible.
|
||||||
|
|
@ -74,115 +72,7 @@ lib.nixvim.plugins.mkNeovimPlugin {
|
||||||
'';
|
'';
|
||||||
|
|
||||||
settingsOptions = {
|
settingsOptions = {
|
||||||
keys = helpers.defaultNullOpts.mkStr "asdghklqwertyuiopzxcvbnmfj" ''
|
direction = lib.nixvim.mkNullOrLua ''
|
||||||
A string representing all the keys that can be part of a permutation.
|
|
||||||
Every character (key) used in the string will be used as part of a permutation.
|
|
||||||
The shortest permutation is a permutation of a single character, and, depending on the
|
|
||||||
content of your buffer, you might end up with 3-character (or more) permutations in worst
|
|
||||||
situations.
|
|
||||||
|
|
||||||
However, it is important to notice that if you decide to provide `keys`, you have to ensure
|
|
||||||
to use enough characters in the string, otherwise you might get very long sequences and a
|
|
||||||
not so pleasant experience.
|
|
||||||
'';
|
|
||||||
|
|
||||||
quit_key = helpers.defaultNullOpts.mkStr "<Esc>" ''
|
|
||||||
A string representing a key that will quit Hop mode without also feeding that key into
|
|
||||||
Neovim to be treated as a normal key press.
|
|
||||||
|
|
||||||
It is possible to quit hopping by pressing any key that is not present in |hop-config-keys|;
|
|
||||||
however, when you do this, the key normal function is also performed.
|
|
||||||
For example if, hopping in |visual-mode|, pressing <Esc> will quit hopping and also exit
|
|
||||||
|visual-mode|.
|
|
||||||
|
|
||||||
If the user presses `quit_key`, Hop will be quit without the key normal function being
|
|
||||||
performed.
|
|
||||||
For example if hopping in |visual-mode| with `quit_key` set to '<Esc>', pressing <Esc> will
|
|
||||||
quit hopping without quitting |visual-mode|.
|
|
||||||
|
|
||||||
If you don't want to use a `quit_key`, set `quit_key` to an empty string.
|
|
||||||
|
|
||||||
Note: `quit_key` should only contain a single key or be an empty string.
|
|
||||||
|
|
||||||
Note: `quit_key` should not contain a key that is also present in |hop-config-keys|.
|
|
||||||
'';
|
|
||||||
|
|
||||||
perm_method = helpers.defaultNullOpts.mkLuaFn "require'hop.perm'.TrieBacktrackFilling" ''
|
|
||||||
Permutation method to use.
|
|
||||||
|
|
||||||
Permutation methods allow to change the way permutations (i.e. hints sequence labels) are
|
|
||||||
generated internally.
|
|
||||||
There is currently only one possible option:
|
|
||||||
- `TrieBacktrackFilling`:
|
|
||||||
Permutation algorithm based on tries and backtrack filling.
|
|
||||||
|
|
||||||
This algorithm uses the full potential of |hop-config-keys| by using them all to saturate
|
|
||||||
a trie, representing all the permutations.
|
|
||||||
Once a layer is saturated, this algorithm will backtrack (from the end of the trie,
|
|
||||||
deepest first) and create a new layer in the trie, ensuring that the first permutations
|
|
||||||
will be shorter than the last ones.
|
|
||||||
|
|
||||||
Because of the last, deepest trie insertion mechanism and trie saturation, this algorithm
|
|
||||||
yields a much better distribution across your buffer, and you should get 1-sequences and
|
|
||||||
2-sequences most of the time.
|
|
||||||
Each dimension grows exponentially, so you get `keys_length²` 2-sequence keys,
|
|
||||||
`keys_length³` 3-sequence keys, etc in the worst cases.
|
|
||||||
'';
|
|
||||||
|
|
||||||
reverse_distribution = helpers.defaultNullOpts.mkBool false ''
|
|
||||||
The default behavior for key sequence distribution in your buffer is to concentrate shorter
|
|
||||||
sequences near the cursor, grouping 1-character sequences around.
|
|
||||||
As hints get further from the cursor, the dimension of the sequences will grow, making the
|
|
||||||
furthest sequences the longest ones to type.
|
|
||||||
|
|
||||||
Set this option to `true` to reverse the density and concentrate the shortest sequences
|
|
||||||
(1-character) around the furthest words and the longest sequences around the cursor.
|
|
||||||
'';
|
|
||||||
|
|
||||||
x_bias = helpers.defaultNullOpts.mkUnsignedInt 10 ''
|
|
||||||
This Determines which hints get shorter key sequences.
|
|
||||||
The default value has a more balanced distribution around the cursor but increasing it means
|
|
||||||
that hints which are closer vertically will have a shorter key sequences.
|
|
||||||
|
|
||||||
For instance, when `x_bias` is set to 100, hints located at the end of the line will have
|
|
||||||
shorter key sequence compared to hints in the lines above or below.
|
|
||||||
'';
|
|
||||||
|
|
||||||
teasing = helpers.defaultNullOpts.mkBool true ''
|
|
||||||
Boolean value stating whether Hop should tease you when you do something you are not
|
|
||||||
supposed to.
|
|
||||||
|
|
||||||
If you find this setting annoying, feel free to turn it to `false`.
|
|
||||||
'';
|
|
||||||
|
|
||||||
virtual_cursor = helpers.defaultNullOpts.mkBool true ''
|
|
||||||
Creates a virtual cursor in place of actual cursor when hop waits for
|
|
||||||
user input to indicate the active window.
|
|
||||||
'';
|
|
||||||
|
|
||||||
jump_on_sole_occurrence = helpers.defaultNullOpts.mkBool true ''
|
|
||||||
Immediately jump without displaying hints if only one occurrence exists.
|
|
||||||
'';
|
|
||||||
|
|
||||||
ignore_injections = helpers.defaultNullOpts.mkBool false ''
|
|
||||||
Ignore injected languages when jumping to treesitter node.
|
|
||||||
'';
|
|
||||||
|
|
||||||
case_insensitive = helpers.defaultNullOpts.mkBool true ''
|
|
||||||
Use case-insensitive matching by default for commands requiring user input.
|
|
||||||
'';
|
|
||||||
|
|
||||||
create_hl_autocmd = helpers.defaultNullOpts.mkBool true ''
|
|
||||||
Create and set highlight autocommands to automatically apply highlights.
|
|
||||||
You will want this if you use a theme that clears all highlights before
|
|
||||||
applying its colorscheme.
|
|
||||||
'';
|
|
||||||
|
|
||||||
dim_unmatched = helpers.defaultNullOpts.mkBool true ''
|
|
||||||
Whether or not dim the unmatched text to emphasize the hint chars.
|
|
||||||
'';
|
|
||||||
|
|
||||||
direction = helpers.mkNullOrLua ''
|
|
||||||
Direction in which to hint.
|
Direction in which to hint.
|
||||||
See `|hop.hint.HintDirection|` for further details.
|
See `|hop.hint.HintDirection|` for further details.
|
||||||
|
|
||||||
|
|
@ -190,82 +80,18 @@ lib.nixvim.plugins.mkNeovimPlugin {
|
||||||
unless overridden.
|
unless overridden.
|
||||||
'';
|
'';
|
||||||
|
|
||||||
hint_position = helpers.defaultNullOpts.mkLua "require'hop.hint'.HintPosition.BEGIN" ''
|
hint_position = lib.nixvim.defaultNullOpts.mkLua "require'hop.hint'.HintPosition.BEGIN" ''
|
||||||
Position of hint in match. See |hop.hint.HintPosition| for further
|
Position of hint in match. See |hop.hint.HintPosition| for further
|
||||||
details.
|
details.
|
||||||
'';
|
'';
|
||||||
|
|
||||||
hint_type = helpers.defaultNullOpts.mkLua "require'hop.hint'.HintType.OVERLAY" ''
|
hint_type = lib.nixvim.defaultNullOpts.mkLua "require'hop.hint'.HintType.OVERLAY" ''
|
||||||
How to show the hint char.
|
How to show the hint char.
|
||||||
|
|
||||||
Possible values:
|
Possible values:
|
||||||
- "overlay": display over the specified column, without shifting the underlying text.
|
- "overlay": display over the specified column, without shifting the underlying text.
|
||||||
- "inline": display at the specified column, and shift the buffer text to the right as needed.
|
- "inline": display at the specified column, and shift the buffer text to the right as needed.
|
||||||
'';
|
'';
|
||||||
|
|
||||||
hint_offset = helpers.defaultNullOpts.mkUnsignedInt 0 ''
|
|
||||||
Offset to apply to a jump location.
|
|
||||||
|
|
||||||
If it is non-zero, the jump target will be offset horizontally from the selected jump position
|
|
||||||
by `hint_offset` character(s).
|
|
||||||
|
|
||||||
This option can be used for emulating the motion commands |t| and |T| where the cursor is
|
|
||||||
positioned on/before the target position.
|
|
||||||
'';
|
|
||||||
|
|
||||||
current_line_only = helpers.defaultNullOpts.mkBool false ''
|
|
||||||
Apply Hop commands only to the current line.
|
|
||||||
|
|
||||||
Note: Trying to use this option along with `multi_windows` is unsound.
|
|
||||||
'';
|
|
||||||
|
|
||||||
uppercase_labels = helpers.defaultNullOpts.mkBool false ''
|
|
||||||
Display labels as uppercase.
|
|
||||||
This option only affects the displayed labels; you still select them by typing the keys on your
|
|
||||||
keyboard.
|
|
||||||
'';
|
|
||||||
|
|
||||||
yank_register = helpers.defaultNullOpts.mkStr "" ''
|
|
||||||
Determines which one of the `registers` stores the yanked text.
|
|
||||||
'';
|
|
||||||
|
|
||||||
extensions = helpers.mkNullOrOption (with types; listOf str) ''
|
|
||||||
List-table of extensions to enable (names).
|
|
||||||
As described in `|hop-extension|`, extensions for which the name in that list must have a
|
|
||||||
`register(opts)` function in their public API for Hop to correctly initialized them.
|
|
||||||
'';
|
|
||||||
|
|
||||||
multi_windows = helpers.defaultNullOpts.mkBool false ''
|
|
||||||
Enable cross-windows support and hint all the currently visible windows.
|
|
||||||
This behavior allows you to jump around any position in any buffer currently visible in a
|
|
||||||
window.
|
|
||||||
Although a powerful a feature, remember that enabling this will also generate many more
|
|
||||||
sequence combinations, so you could get deeper sequences to type (most of the time it
|
|
||||||
should be good if you have enough keys in `|hop-config-keys|`).
|
|
||||||
'';
|
|
||||||
|
|
||||||
excluded_filetypes = helpers.defaultNullOpts.mkListOf types.str [ ] ''
|
|
||||||
Skip hinting windows with the excluded filetypes.
|
|
||||||
Those windows to check filetypes are collected only when you enable `multi_windows` or
|
|
||||||
execute `MW`-commands.
|
|
||||||
This option is useful to skip the windows which are only for displaying something but not
|
|
||||||
for editing.
|
|
||||||
'';
|
|
||||||
|
|
||||||
match_mappings = helpers.defaultNullOpts.mkListOf types.str [ ] ''
|
|
||||||
This option allows you to specify the match mappings to use when applying the hint.
|
|
||||||
If you set a non-empty `match_mappings`, the hint will be used as a key to look up the
|
|
||||||
pattern to search for.
|
|
||||||
|
|
||||||
Currently supported mappings:~
|
|
||||||
- 'fa' : farsi characters
|
|
||||||
- 'zh' : Basic characters for Chinese
|
|
||||||
- 'zh_sc' : Simplified Chinese
|
|
||||||
- 'zh_tc' : Traditional Chinese
|
|
||||||
|
|
||||||
For example, if `match_mappings` is set to `["zh" "zh_sc"], the characters in "zh" and
|
|
||||||
"zh_sc" can be mixed to match together.
|
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
|
|
||||||
settingsExample = {
|
settingsExample = {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue