From ed0bd3cc06af1aa337ddefc67b067d2be4522fa0 Mon Sep 17 00:00:00 2001 From: "Christoph J. Scherr" Date: Mon, 8 Jul 2024 11:12:31 +0200 Subject: [PATCH] vim-illuminate jump explanation --- lua/custom/plugins/ui.lua | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lua/custom/plugins/ui.lua b/lua/custom/plugins/ui.lua index a17b2e5..e7e9634 100644 --- a/lua/custom/plugins/ui.lua +++ b/lua/custom/plugins/ui.lua @@ -273,6 +273,17 @@ return { 'neo-tree', }, }, + -- looks weird but is useful: put your cursor on a word and other occurences + -- of the word in your buffer will be highlighted. You can then use + -- '[[' and ']]' to go to the next or previous occurence. + -- + -- Try it: + -- + -- word #### word ########### + -- ############## word ###### + -- #### word #### word word # + -- + -- (It might not work with comments) keys = { { ']]', desc = 'Next Reference' }, { '[[', desc = 'Prev Reference' }, @@ -280,6 +291,7 @@ return { config = function(_, opts) require('illuminate').configure(opts) + -- only magic follows local function map(key, dir, buffer) vim.keymap.set('n', key, function() require('illuminate')['goto_' .. dir .. '_reference'](false)