plugins.hop.settings
Options provided to the require('hop').setup
function.
Type: attribute set of anything
Default:
{ }
Example:
{
case_insensitive = false;
dim_unmatched = true;
direction = "require'hop.hint'.HintDirection.BEFORE_CURSOR";
hint_position = "require'hop.hint'.HintPosition.BEGIN";
hint_type = "require'hop.hint'.HintType.OVERLAY";
jump_on_sole_occurrence = true;
keys = "asdghklqwertyuiopzxcvbnmfj";
match_mappings = [
"zh"
"zh_sc"
];
quit_key = "<Esc>";
reverse_distribution = false;
teasing = true;
virtual_cursor = true;
x_bias = 10;
}
Declared by:
plugins.hop.settings.case_insensitive
Use case-insensitive matching by default for commands requiring user input.
Plugin default: true
Type: null or boolean or raw lua code
Default:
null
Declared by:
plugins.hop.settings.create_hl_autocmd
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.
Plugin default: true
Type: null or boolean or raw lua code
Default:
null
Declared by:
plugins.hop.settings.current_line_only
Apply Hop commands only to the current line.
Note: Trying to use this option along with multi_windows
is unsound.
Plugin default: false
Type: null or boolean or raw lua code
Default:
null
Declared by:
plugins.hop.settings.dim_unmatched
Whether or not dim the unmatched text to emphasize the hint chars.
Plugin default: true
Type: null or boolean or raw lua code
Default:
null
Declared by:
plugins.hop.settings.direction
Direction in which to hint.
See |hop.hint.HintDirection|
for further details.
Setting this in the user configuration will make all commands default to that direction, unless overridden.
Type: null or lua code string
Default:
null
Declared by:
plugins.hop.settings.excluded_filetypes
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.
Plugin default: []
Type: null or (list of (string or raw lua code))
Default:
null
Declared by:
plugins.hop.settings.extensions
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.
Type: null or (list of string)
Default:
null
Declared by:
plugins.hop.settings.hint_offset
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.
Plugin default: 0
Type: null or unsigned integer, meaning >=0, or raw lua code
Default:
null
Declared by:
plugins.hop.settings.hint_position
Position of hint in match. See |hop.hint.HintPosition| for further details.
Plugin default: require'hop.hint'.HintPosition.BEGIN
Type: null or lua code string
Default:
null
Declared by:
plugins.hop.settings.hint_type
How to show the hint char.
Possible values:
- “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.
Plugin default: require'hop.hint'.HintType.OVERLAY
Type: null or lua code string
Default:
null
Declared by:
plugins.hop.settings.ignore_injections
Ignore injected languages when jumping to treesitter node.
Plugin default: false
Type: null or boolean or raw lua code
Default:
null
Declared by:
plugins.hop.settings.jump_on_sole_occurrence
Immediately jump without displaying hints if only one occurrence exists.
Plugin default: true
Type: null or boolean or raw lua code
Default:
null
Declared by:
plugins.hop.settings.keys
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.
Plugin default: "asdghklqwertyuiopzxcvbnmfj"
Type: null or string or raw lua code
Default:
null
Declared by:
plugins.hop.settings.match_mappings
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.
Plugin default: []
Type: null or (list of (string or raw lua code))
Default:
null
Declared by:
plugins.hop.settings.multi_windows
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|
).
Plugin default: false
Type: null or boolean or raw lua code
Default:
null
Declared by:
plugins.hop.settings.perm_method
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.
Plugin default: require'hop.perm'.TrieBacktrackFilling
Type: null or lua function string
Default:
null
Declared by:
plugins.hop.settings.quit_key
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|.
Plugin default: "<Esc>"
Type: null or string or raw lua code
Default:
null
Declared by:
plugins.hop.settings.reverse_distribution
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.
Plugin default: false
Type: null or boolean or raw lua code
Default:
null
Declared by:
plugins.hop.settings.teasing
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
.
Plugin default: true
Type: null or boolean or raw lua code
Default:
null
Declared by:
plugins.hop.settings.uppercase_labels
Display labels as uppercase. This option only affects the displayed labels; you still select them by typing the keys on your keyboard.
Plugin default: false
Type: null or boolean or raw lua code
Default:
null
Declared by:
plugins.hop.settings.virtual_cursor
Creates a virtual cursor in place of actual cursor when hop waits for user input to indicate the active window.
Plugin default: true
Type: null or boolean or raw lua code
Default:
null
Declared by:
plugins.hop.settings.x_bias
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.
Plugin default: 10
Type: null or unsigned integer, meaning >=0, or raw lua code
Default:
null
Declared by:
plugins.hop.settings.yank_register
Determines which one of the registers
stores the yanked text.
Plugin default: ""
Type: null or string or raw lua code
Default:
null
Declared by: