diff --git a/init.lua b/init.lua index 6c42297..1b1b2ba 100644 --- a/init.lua +++ b/init.lua @@ -37,6 +37,8 @@ vim.opt.cmdheight = 2 -- Shows better messages vim.opt.foldmethod = "indent" vim.opt.foldlevel = 99 +vim.g.mapleader = " " -- set leader key to space +vim.g.maplocalleader = " " -- set local leader key to space require("config.lazy") diff --git a/lua/config/lazy.lua b/lua/config/lazy.lua index 1376fcf..32d75cd 100644 --- a/lua/config/lazy.lua +++ b/lua/config/lazy.lua @@ -50,7 +50,7 @@ if vim.g.vscode then } vim.keymap.set('n', '', codeReader.quickInfo) - + require("lazy").setup({ spec = { -- import your plugins @@ -62,6 +62,31 @@ if vim.g.vscode then -- 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}) + else require("lazy").setup({ spec = {