From aab38f32e0a02e43565a554d0a76ff65636499b8 Mon Sep 17 00:00:00 2001 From: Michal Hanus Date: Sat, 2 Mar 2024 18:49:55 +0100 Subject: crazyshit --- lua/config/hlslens.lua | 49 ------------------------------------------------- 1 file changed, 49 deletions(-) delete mode 100644 lua/config/hlslens.lua (limited to 'lua/config/hlslens.lua') diff --git a/lua/config/hlslens.lua b/lua/config/hlslens.lua deleted file mode 100644 index 430bd23..0000000 --- a/lua/config/hlslens.lua +++ /dev/null @@ -1,49 +0,0 @@ -local api = vim.api -local keymap = vim.keymap - -local hlslens = require("hlslens") - -hlslens.setup { - calm_down = true, - nearest_only = true, -} - -local activate_hlslens = function(direction) - local cmd = string.format("normal! %s%szzzv", vim.v.count1, direction) - local status, msg = pcall(vim.cmd, cmd) - - -- Deal with the case that there is no such pattern in current buffer. - if not status then - local start_idx, _ = string.find(msg, 'E486', 1, true) - local msg_part = string.sub(msg, start_idx) - api.nvim_err_writeln(msg_part) - return - end - - hlslens.start() -end - -keymap.set("n", "n", "", { - callback = function() - activate_hlslens("n") - end, -}) - -keymap.set("n", "N", "", { - callback = function() - activate_hlslens("N") - end, -}) - -keymap.set("n", "*", "", { - callback = function() - vim.fn.execute("normal! *N") - hlslens.start() - end, -}) -keymap.set("n", "#", "", { - callback = function() - vim.fn.execute("normal! #N") - hlslens.start() - end, -}) -- cgit v1.2.3