diff --git a/lua/config/lazy.lua b/lua/config/lazy.lua index 32d75cd..55fa4f2 100644 --- a/lua/config/lazy.lua +++ b/lua/config/lazy.lua @@ -99,4 +99,29 @@ else -- automatically check for plugin updates checker = { enabled = true }, }) + + local hop = require('hop') + local directions = require('hop.hint').HintDirection + vim.keymap.set('n', 'f', function() + hop.hint_char1({ direction = directions.AFTER_CURSOR, current_line_only = true }) + end, {remap=true}) + vim.keymap.set('n', 'F', function() + hop.hint_char1({ direction = directions.BEFORE_CURSOR, current_line_only = true }) + end, {remap=true}) + vim.keymap.set('n', 't', function() + hop.hint_char1({ direction = directions.AFTER_CURSOR, current_line_only = true, hint_offset = -1 }) + end, {remap=true}) + vim.keymap.set('n', 'T', function() + hop.hint_char1({ direction = directions.BEFORE_CURSOR, current_line_only = true, hint_offset = 1 }) + end, {remap=true}) + vim.keymap.set('n', 's', function() + hop.hint_char1() + end, {remap=true}) + vim.keymap.set('n', 'S', function() + hop.hint_char2() + end, {remap=true}) + vim.keymap.set('n', 'sw', function() + hop.hint_words() + end, {remap=true}) + end diff --git a/lua/plugins/hop.lua b/lua/plugins/hop.lua new file mode 100644 index 0000000..0665ffb --- /dev/null +++ b/lua/plugins/hop.lua @@ -0,0 +1,9 @@ +return{ + { + 'smoka7/hop.nvim', + version = "*", + opts = { + keys = 'etovxqpdygfblzhckisuran' + } + } +}