commit 20afc736e4ed59724b5413cd89de567a2b7a1139 (patch)
parent 932bcaf724d1202a6556a284ab9d02b69805f80d
Author: Alex Karle <alex@alexkarle.com>
Date: Tue, 29 Nov 2022 10:38:39 -0500
nvim: Add git-grep keybinding
This is a holdover from the pre-lua days that never made it into the new
config. It's super useful though!
Diffstat:
1 file changed, 4 insertions(+), 0 deletions(-)
diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua
@@ -31,5 +31,9 @@ vim.api.nvim_set_keymap("n", "<C-j>", "<C-w>j", { noremap = true })
vim.api.nvim_set_keymap("n", "<C-k>", "<C-w>k", { noremap = true })
vim.api.nvim_set_keymap("n", "<C-l>", "<C-w>l", { noremap = true })
+-- Fast git-grepping
+vim.cmd [[let mapleader = " "]]
+vim.api.nvim_set_keymap("n", "<leader>G", ":Ggrep! <cword><CR>:copen<CR>", { noremap = true })
+
-- Lastly, source a local config, if it exists
vim.cmd [[runtime! local.lua]]