nvim: after/plugin/mini: Use jump2d for f, F, t, T motions

mini.jump module does not give multiple hints when moving on the
same line like hop use to. Use the jump2d module to achieve this
functionality. This makes it easy to jump forward or backward on
the same line with just one hop instead of having to press f/F
multiple times which is just annoying and stupid.
This commit is contained in:
Sanchayan Maity 2023-06-28 09:40:59 +05:30
parent 0265000a4f
commit 9c9dc6a6b8
Signed by: sanchayanmaity
GPG key ID: 6F6A0609C12038F3

View file

@ -10,8 +10,6 @@ require('mini.align').setup({
}) })
-- Comment lines -- Comment lines
require('mini.comment').setup() require('mini.comment').setup()
-- For f, F, t, t motions/Horizontal movement
require('mini.jump').setup({silent = true})
-- Vertical jumps/movement -- Vertical jumps/movement
require('mini.jump2d').setup({ require('mini.jump2d').setup({
allowed_lines = { allowed_lines = {
@ -67,3 +65,18 @@ remap({ 'n', 'o', 'x' }, 'gl', function()
return mini_jump2d.start(line_start) return mini_jump2d.start(line_start)
end, opts) end, opts)
-- Replacement for f, F, t, T motions/Horizontal movement
remap({ 'n', 'o', 'x' }, 'f', function()
local mini_jump2d = require('mini.jump2d')
local single_char = mini_jump2d.builtin_opts.single_character
single_char.allowed_lines = {
blank = false,
cursor_before = false,
cursor_at = true ,
cursor_after = false,
fold = false,
}
return mini_jump2d.start(single_char)
end, opts)