Skip to content
Discussion options

You must be logged in to vote

This is already possible with opts.search_method='prev'. So something like this should work:

local make_ai_jump = function(side, tobj_id, search_method)
  return function() MiniAi.move_cursor(side, 'a', tobj_id, { n_times = vim.v.count1, search_method = search_method }) end
end
vim.keymap.set('n', ',e', make_ai_jump('left', 'e', 'cover_or_next'), { desc = 'Next subword' })
vim.keymap.set('n', ',E', make_ai_jump('left', 'e', 'prev'), { desc = 'Prev subword' })

Adjust search_method values to your liking (like 'cover_or_prev' instead of 'prev', etc.).

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@drowning-cat
Comment options

Answer selected by drowning-cat
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
2 participants