summaryrefslogtreecommitdiff
path: root/.config/nvim/lua/plugins/leap.lua
diff options
context:
space:
mode:
Diffstat (limited to '.config/nvim/lua/plugins/leap.lua')
-rw-r--r--.config/nvim/lua/plugins/leap.lua16
1 files changed, 16 insertions, 0 deletions
diff --git a/.config/nvim/lua/plugins/leap.lua b/.config/nvim/lua/plugins/leap.lua
new file mode 100644
index 0000000..3c4e99e
--- /dev/null
+++ b/.config/nvim/lua/plugins/leap.lua
@@ -0,0 +1,16 @@
+return {
+ 'ggandor/leap.nvim',
+ dependencies = { "tpope/vim-repeat" },
+ config = function()
+ vim.keymap.set({ 'n', 'x', 'o' }, 's', '<Plug>(leap-forward)')
+ vim.keymap.set({ 'n', 'x', 'o' }, 'S', '<Plug>(leap-backward)')
+ vim.keymap.set({ 'n', 'x', 'o' }, 'gs', '<Plug>(leap-from-window)')
+
+ -- Define equivalence classes for brackets and quotes, in addition to
+ -- the default whitespace group.
+ require('leap').opts.equivalence_classes = { ' \t\r\n', '([{', ')]}', '\'"`' }
+
+ -- Set background to gray in searchable area
+ vim.api.nvim_set_hl(0, 'LeapBackdrop', { fg = '#777777' })
+ end,
+}