1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-01-24 05:40:05 +08:00
SpaceVim/lua/spacevim/plugin/hop.lua

23 lines
652 B
Lua
Raw Normal View History

local M = {}
-- Like hop.jump_target.regex_by_line_start_skip_whitespace() except it also
-- marks empty or whitespace only lines
local function regexLines()
return {
oneshot = true,
match = function(str)
return vim.regex('http[s]*://'):match_str(str)
end,
}
end
-- Like :HopLineStart except it also jumps to empty or whitespace only lines
function M.hintLines(opts)
-- Taken from override_opts()
opts = setmetatable(opts or {}, { __index = require('hop').opts })
local gen = require('hop.jump_target').jump_targets_by_scanning_lines
require('hop').hint_with(gen(regexLines()), opts)
end
return M