diff --git a/flake.lock b/flake.lock index 6df72d3..3543141 100644 --- a/flake.lock +++ b/flake.lock @@ -38,6 +38,7 @@ "editorconfig-nvim": "editorconfig-nvim", "nixpkgs": "nixpkgs", "tabby-nvim": "tabby-nvim", + "telescope-live-grep-args-nvim": "telescope-live-grep-args-nvim", "utils": "utils" } }, @@ -58,6 +59,23 @@ "type": "github" } }, + "telescope-live-grep-args-nvim": { + "flake": false, + "locked": { + "lastModified": 1661594012, + "narHash": "sha256-T5j2qgoDtVkk1uCLjoNeyw4eTu6eLbTXQHUuvHs3Tls=", + "owner": "nvim-telescope", + "repo": "telescope-live-grep-args.nvim", + "rev": "32b633b062d1168a2d18ad27994e5b4ef97f0a74", + "type": "github" + }, + "original": { + "owner": "nvim-telescope", + "repo": "telescope-live-grep-args.nvim", + "rev": "32b633b062d1168a2d18ad27994e5b4ef97f0a74", + "type": "github" + } + }, "utils": { "locked": { "lastModified": 1659877975, diff --git a/flake.nix b/flake.nix index c28450b..7a66f1e 100644 --- a/flake.nix +++ b/flake.nix @@ -12,6 +12,11 @@ url = "github:gpanders/editorconfig.nvim?rev=7d10fe6bc340fd783c0b61cf627dd235100284db"; flake = false; }; + + telescope-live-grep-args-nvim = { + url = "github:nvim-telescope/telescope-live-grep-args.nvim?rev=32b633b062d1168a2d18ad27994e5b4ef97f0a74"; + flake = false; + }; }; outputs = inputs @ { self, nixpkgs, utils, ... }: @@ -22,6 +27,7 @@ overlays = [ (f: p: { vimPlugins = p.vimPlugins // { + # TODO: make util to build plugins from array tabby-nvim = p.vimUtils.buildVimPluginFrom2Nix { name = "tabby-nvim"; src = inputs.tabby-nvim; @@ -30,6 +36,10 @@ name = "editorconfig-nvim"; src = inputs.editorconfig-nvim; }; + telescope-live-grep-args-nvim = p.vimUtils.buildVimPluginFrom2Nix { + name = "telescope-live-grep-args-nvim"; + src = inputs.telescope-live-grep-args-nvim; + }; }; }) ]; diff --git a/plugins/explorer/default.nix b/plugins/explorer/default.nix index e212b99..2ee19ff 100644 --- a/plugins/explorer/default.nix +++ b/plugins/explorer/default.nix @@ -1,11 +1,9 @@ -{ nvim-tree-lua, telescope-nvim, ... }: +{ nvim-tree-lua, telescope-nvim, telescope-live-grep-args-nvim, ... }: { luaConfig = (builtins.readFile ./nvim-tree.lua) + (builtins.readFile ./telescope-nvim.lua); - plugins = [ - nvim-tree-lua - telescope-nvim - ]; + plugins = [ nvim-tree-lua ] + ++ [ telescope-nvim telescope-live-grep-args-nvim ]; } diff --git a/plugins/explorer/telescope-nvim.lua b/plugins/explorer/telescope-nvim.lua index 6beb620..4dfe19b 100644 --- a/plugins/explorer/telescope-nvim.lua +++ b/plugins/explorer/telescope-nvim.lua @@ -1,7 +1,13 @@ -- See: https://github.com/nvim-telescope/telescope.nvim -require("telescope").setup({}) +local telescope = require("telescope") + +telescope.setup({}) vim.keymap.set("n", "ff", "Telescope find_files hidden=true") -vim.keymap.set("n", "fg", "Telescope live_grep") vim.keymap.set("n", "fb", "Telescope buffers") vim.keymap.set("n", "fh", "Telescope help_tags") + +-- required telescope-live-grep-args-nvim plugin +vim.keymap.set("n", "fg", function() + telescope.extensions.live_grep_args.live_grep_args() +end)