From c16cb3181a78b1b5ac5368af1bb43fe4fe82f5df Mon Sep 17 00:00:00 2001 From: Stefan Imhoff Date: Sun, 20 Aug 2023 08:22:00 +0200 Subject: [PATCH] feat: add shortcuts for global grep search --- fish/config.fish | 4 ++++ nvim/lua/config/lazy.lua | 4 ++++ wezterm/wezterm.lua | 3 ++- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/fish/config.fish b/fish/config.fish index c5e92c5..f19b173 100644 --- a/fish/config.fish +++ b/fish/config.fish @@ -201,5 +201,9 @@ alias cpg copilot_git-assist alias cpgh copilot_github-assist alias wts copilot_what-the-shell +# Nvim +alias :GoToFile "nvim +GoToFile" +alias :Grep "nvim +Grep" + # Prompt starship init fish | source diff --git a/nvim/lua/config/lazy.lua b/nvim/lua/config/lazy.lua index d1e8676..4f48e76 100644 --- a/nvim/lua/config/lazy.lua +++ b/nvim/lua/config/lazy.lua @@ -4,7 +4,11 @@ if not vim.loop.fs_stat(lazypath) then -- stylua: ignore vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", "--branch=stable", lazypath }) end + vim.opt.rtp:prepend(vim.env.LAZY or lazypath) +vim.cmd([[command! -nargs=0 GoToFile :Telescope find_files]]) +vim.cmd([[command! -nargs=0 GoToCommand :Telescope commands]]) +vim.cmd([[command! -nargs=0 Grep :Telescope live_grep]]) require("lazy").setup({ spec = { diff --git a/wezterm/wezterm.lua b/wezterm/wezterm.lua index 929be98..ed9ee8b 100644 --- a/wezterm/wezterm.lua +++ b/wezterm/wezterm.lua @@ -61,7 +61,8 @@ config.keys = { { key = "[", mods = "CTRL|ALT", action = wezterm.action({ SendString = "\2p" }) }, { key = "]", mods = "CTRL|ALT", action = wezterm.action({ SendString = "\2n" }) }, { key = "d", mods = "CTRL|ALT", action = wezterm.action({ SendString = "\2d" }) }, - { key = "f", mods = "CTRL|ALT", action = wezterm.action({ SendString = "\2O" }) }, + { key = "f", mods = "CTRL|ALT", action = wezterm.action({ SendString = ":Grep\n" }) }, + { key = "f", mods = "CTRL|ALT|SHIFT", action = wezterm.action({ SendString = "\2O" }) }, { key = "g", mods = "CTRL|ALT", action = wezterm.action({ SendString = "\2G" }) }, { key = "h", mods = "CTRL|ALT", action = wezterm.action({ SendString = "\2p" }) }, { key = "i", mods = "CTRL|ALT", action = wezterm.action({ SendString = "\2i" }) },