From 58e8cddefcef21c4865bc715f567ee9311df904b Mon Sep 17 00:00:00 2001 From: ralvescosta Date: Sun, 16 Mar 2025 19:55:53 -0300 Subject: [PATCH] feat: hop ocnfigs --- lua/custom/plugins/hop.lua | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/lua/custom/plugins/hop.lua b/lua/custom/plugins/hop.lua index 36037f05..a5177211 100644 --- a/lua/custom/plugins/hop.lua +++ b/lua/custom/plugins/hop.lua @@ -3,7 +3,26 @@ return { 'phaazon/hop.nvim', branch = 'v2', config = function() - require('hop').setup() + local hop = require 'hop' + + hop.setup() + + local directions = require('hop.hint').HintDirection + vim.keymap.set('', 'f', function() + hop.hint_char1 { direction = directions.AFTER_CURSOR, current_line_only = true } + end, { remap = true }) + + vim.keymap.set('', 'F', function() + hop.hint_char1 { direction = directions.BEFORE_CURSOR, current_line_only = true } + end, { remap = true }) + + vim.keymap.set('', 't', function() + hop.hint_char1 { direction = directions.AFTER_CURSOR, current_line_only = true, hint_offset = -1 } + end, { remap = true }) + + vim.keymap.set('', 'T', function() + hop.hint_char1 { direction = directions.BEFORE_CURSOR, current_line_only = true, hint_offset = 1 } + end, { remap = true }) end, }, }