plugin/explorer: add telescope-live-grep-args plugin

This commit is contained in:
Dmitriy Pleshevskiy 2022-09-19 19:25:59 +03:00
parent a8cdb463fa
commit 3e991b54ea
Signed by: pleshevskiy
GPG Key ID: 1B59187B161C0215
4 changed files with 39 additions and 7 deletions

View File

@ -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,

View File

@ -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;
};
};
})
];

View File

@ -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 ];
}

View File

@ -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", "<leader>ff", "<Cmd>Telescope find_files hidden=true<CR>")
vim.keymap.set("n", "<leader>fg", "<Cmd>Telescope live_grep<CR>")
vim.keymap.set("n", "<leader>fb", "<Cmd>Telescope buffers<CR>")
vim.keymap.set("n", "<leader>fh", "<Cmd>Telescope help_tags<CR>")
-- required telescope-live-grep-args-nvim plugin
vim.keymap.set("n", "<leader>fg", function()
telescope.extensions.live_grep_args.live_grep_args()
end)