From 20c0af47a69c13c776c6c72e7e0a82f10e8862bd Mon Sep 17 00:00:00 2001 From: ViViDboarder Date: Wed, 17 Jul 2024 17:36:44 -0700 Subject: [PATCH] Update min and more lazify --- neovim/lua/init.lua | 4 ++-- neovim/lua/lazy_init.lua | 2 -- neovim/lua/lazy_plugins.lua | 35 ++++++++++++++++++++++++++++++++-- neovim/lua/plugins/grepper.lua | 29 ---------------------------- 4 files changed, 35 insertions(+), 35 deletions(-) delete mode 100644 neovim/lua/plugins/grepper.lua diff --git a/neovim/lua/init.lua b/neovim/lua/init.lua index 6913c25..6120c17 100644 --- a/neovim/lua/init.lua +++ b/neovim/lua/init.lua @@ -1,5 +1,5 @@ -if vim.fn.has("nvim-0.7.0") ~= 1 then - print("ERROR: Requires nvim >= 0.7.0") +if vim.fn.has("nvim-0.9.0") ~= 1 then + print("ERROR: Requires nvim >= 0.9.0") end local o = vim.o diff --git a/neovim/lua/lazy_init.lua b/neovim/lua/lazy_init.lua index 1b66579..c9ba82a 100644 --- a/neovim/lua/lazy_init.lua +++ b/neovim/lua/lazy_init.lua @@ -19,8 +19,6 @@ vim.opt.rtp:prepend(lazypath) -- Setup lazy.nvim require("lazy").setup({ spec = { - -- TODO: Move plugins to be split by plugin or feature types - -- { import = "plugins" }, { import = "lazy_plugins" }, }, lockfile = vim.fn.stdpath("config") .. utils.map_version_rule({ diff --git a/neovim/lua/lazy_plugins.lua b/neovim/lua/lazy_plugins.lua index 920835b..b04ee9e 100644 --- a/neovim/lua/lazy_plugins.lua +++ b/neovim/lua/lazy_plugins.lua @@ -113,10 +113,41 @@ return { -- Find text everywhere! { - -- TODO: Maybe replace this with Telescope? "https://github.com/mhinz/vim-grepper", config = function() - require("plugins.grepper") + -- Grepper settings and shortcuts + vim.g.grepper = { + quickfix = 1, + open = 1, + switch = 0, + jump = 0, + tools = { "git", "rg", "ag", "ack", "pt", "grep" }, + dir = "repo,cwd", + } + + require("utils").keymap_set({ "n", "x" }, "gs", "(GrepperOperator)", { + silent = true, + noremap = false, + desc = "Grepper", + }) + + -- Override Todo command to use Grepper + vim.api.nvim_create_user_command( + "Todo", + ":Grepper -noprompt -query TODO", + { desc = "Search for TODO tags" } + ) + + -- Make some shortands for various grep programs + if vim.fn.executable("rg") == 1 then + vim.api.nvim_create_user_command("Rg", ":GrepperRg ", { nargs = "+", desc = "Ripgrep" }) + end + if vim.fn.executable("ag") == 1 then + vim.api.nvim_create_user_command("Ag", ":GrepperAg ", { nargs = "+", desc = "Silversearcher" }) + end + if vim.fn.executable("ack") == 1 then + vim.api.nvim_create_user_command("Ack", ":GrepperAck ", { nargs = "+", desc = "Ack search" }) + end end, }, diff --git a/neovim/lua/plugins/grepper.lua b/neovim/lua/plugins/grepper.lua deleted file mode 100644 index 1d3dfca..0000000 --- a/neovim/lua/plugins/grepper.lua +++ /dev/null @@ -1,29 +0,0 @@ --- Grepper settings and shortcuts -vim.g.grepper = { - quickfix = 1, - open = 1, - switch = 0, - jump = 0, - tools = { "git", "rg", "ag", "ack", "pt", "grep" }, - dir = "repo,cwd", -} - -require("utils").keymap_set({ "n", "x" }, "gs", "(GrepperOperator)", { - silent = true, - noremap = false, - desc = "Grepper", -}) - --- Override Todo command to use Grepper -vim.api.nvim_create_user_command("Todo", ":Grepper -noprompt -query TODO", { desc = "Search for TODO tags" }) - --- Make some shortands for various grep programs -if vim.fn.executable("rg") == 1 then - vim.api.nvim_create_user_command("Rg", ":GrepperRg ", { nargs = "+", desc = "Ripgrep" }) -end -if vim.fn.executable("ag") == 1 then - vim.api.nvim_create_user_command("Ag", ":GrepperAg ", { nargs = "+", desc = "Silversearcher" }) -end -if vim.fn.executable("ack") == 1 then - vim.api.nvim_create_user_command("Ack", ":GrepperAck ", { nargs = "+", desc = "Ack search" }) -end