From acb423984a2647e716d4fcfdc6c7496159493538 Mon Sep 17 00:00:00 2001 From: jdhao Date: Wed, 5 Oct 2022 12:40:53 +0800 Subject: [PATCH] remove vim-asterisk The * can now search selected text by default. The cursor stay feature can also be simulated. --- lua/config/hlslens.lua | 14 ++++++++++++-- lua/plugins.lua | 3 --- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/lua/config/hlslens.lua b/lua/config/hlslens.lua index 13541c4..e23671f 100644 --- a/lua/config/hlslens.lua +++ b/lua/config/hlslens.lua @@ -34,5 +34,15 @@ keymap.set("n", "N", "", { end, }) -keymap.set("n", "*", "(asterisk-z*)lua require('hlslens').start()") -keymap.set("n", "#", "(asterisk-z#)lua require('hlslens').start()") +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, +}) diff --git a/lua/plugins.lua b/lua/plugins.lua index d60856c..14e6229 100644 --- a/lua/plugins.lua +++ b/lua/plugins.lua @@ -99,9 +99,6 @@ packer.startup { config = [[require('config.hlslens')]], } - -- Stay after pressing * and search selected text - use { "haya14busa/vim-asterisk", event = "VimEnter" } - -- File search, tag search and more if vim.g.is_win then use { "Yggdroot/LeaderF", cmd = "Leaderf" }