You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I found out about the custom callback feature, so I decided to implement my first one in my neovim config. This simply extends the HopLineStart to immediately enter insert mode on a new line:
localhop=require("hop")
hop.setup({})
localhop_insert_line=function()
localregex=require("hop.jump_regex").regex_by_line_start_skip_whitespace()
localtarget=require("hop.jump_target").jump_target_generator(regex)
hop.hint_with_callback(target, hop.opts, function(jt)
hop.move_cursor_to(jt, hop.opts)
-- v this the critical linevim.api.nvim_input("o")
end)
endvim.keymap.set("n", "go", hop_insert_line)
I feel this is a lot of boilerplate for a single lua command callback to a single default target. Is there an easier way to implement this? If not, could the default targets accept a callback as an optional parameter?
The help documentation is excellent, but it is lacking an example that would have likely saved me some time. Would adding my example to the wiki, hop.txt, or examples make sense?
The text was updated successfully, but these errors were encountered:
I found out about the custom callback feature, so I decided to implement my first one in my neovim config. This simply extends the HopLineStart to immediately enter insert mode on a new line:
I feel this is a lot of boilerplate for a single lua command callback to a single default target. Is there an easier way to implement this? If not, could the default targets accept a callback as an optional parameter?
The help documentation is excellent, but it is lacking an example that would have likely saved me some time. Would adding my example to the wiki, hop.txt, or examples make sense?
The text was updated successfully, but these errors were encountered: