leap.lua (932B)
1 if not pcall(require, 'leap') then 2 return 3 end 4 5 local leap = require 'leap' 6 7 vim.keymap.set('n', 'S', function() 8 leap.leap { target_windows = vim.api.nvim_tabpage_list_wins(0) } 9 end) 10 11 if pcall(require, 'tms.p.leap.line') then 12 -- For maximum comfort, force linewise selection in the mappings: 13 vim.keymap.set('x', '|', function() 14 -- Only force V if not already in it (otherwise it would exit Visual mode). 15 if vim.fn.mode(1) ~= 'V' then vim.cmd('normal! V') end 16 require 'tms.p.leap.line'.leap_line_start() 17 end) 18 vim.keymap.set('o', '|', "V<cmd>lua require 'tms.p.leap.line'.leap_line_start()<cr>") 19 end 20 21 if pcall(require, 'tms.p.leap.ast') then 22 vim.keymap.set({ 'x', 'o' }, 'gp', function() 23 require 'tms.p.leap.ast'.leap_ts() 24 end, { desc = 'Leap AST' }) 25 end 26 27 if pcall(require, 'telepath') then 28 require 'telepath'.use_default_mappings {} 29 end 30 31 if pcall(require, 'flit') then 32 require('flit').setup {} 33 end