Read-only mirror of https://codeberg.org/andyg/leap.nvim
at main 26 lines 1.0 kB view raw
1-- We're exposing some fields from other modules here so that they can 2-- be accessed directly as `require('leap').foo`. Using a metatable is a 3-- convenient way to avoid requiring the modules ahead of time. 4 5return setmetatable({}, { 6 __index = function(_, k) 7 if k == 'leap' then 8 return require('leap.main').leap 9 elseif k == 'opts' then 10 return require('leap.opts').default 11 elseif k == 'state' then 12 return require('leap.main').state 13 elseif k == 'init_hl' then 14 return function(...) require('leap.highlight'):init(...) end 15 -- Deprecated ones. 16 elseif k == 'setup' then 17 return require('leap.user').setup 18 elseif k == 'add_default_mappings' then 19 return require('leap.user').add_default_mappings 20 elseif k == 'add_repeat_mappings' then 21 return require('leap.user').add_repeat_mappings 22 elseif k == 'init_highlight' then 23 return function(...) return require('leap.highlight'):init(...) end 24 end 25 end, 26})