From 1a2bb7dce6702fe43e60d3d4fc608edc8a7d1f7e Mon Sep 17 00:00:00 2001 From: Ruslan Date: Sat, 8 Jun 2024 18:52:15 +0300 Subject: [PATCH] [telescope] remove gitfiles from the default files tab --- lazy-lock.json | 1 + lua/crentist/lazy/telescope.lua | 33 ++++++++++++++++++++++++--------- 2 files changed, 25 insertions(+), 9 deletions(-) diff --git a/lazy-lock.json b/lazy-lock.json index dd93d8b..7e0dbe4 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -25,6 +25,7 @@ "nvim-web-devicons": { "branch": "master", "commit": "b77921fdc44833c994fdb389d658ccbce5490c16" }, "plenary": { "branch": "master", "commit": "a3e3bc82a3f95c5ed0d7201546d5d2c19b20d683" }, "plenary.nvim": { "branch": "master", "commit": "a3e3bc82a3f95c5ed0d7201546d5d2c19b20d683" }, + "search.nvim": { "branch": "main", "commit": "7b8f2315d031be73e14bc2d82386dfac15952614" }, "telescope.nvim": { "branch": "master", "commit": "6312868392331c9c0f22725041f1ec2bef57c751" }, "undotree": { "branch": "master", "commit": "56c684a805fe948936cda0d1b19505b84ad7e065" }, "vim-be-good": { "branch": "master", "commit": "4fa57b7957715c91326fcead58c1fa898b9b3625" }, diff --git a/lua/crentist/lazy/telescope.lua b/lua/crentist/lazy/telescope.lua index eb1f76b..d9c041d 100644 --- a/lua/crentist/lazy/telescope.lua +++ b/lua/crentist/lazy/telescope.lua @@ -1,18 +1,34 @@ return { - "nvim-telescope/telescope.nvim", + "FabianWirth/search.nvim", + dependencies = { + "nvim-lua/plenary.nvim", + "nvim-telescope/telescope.nvim", + }, version = "0.1.6", - dependencies = { - "nvim-lua/plenary.nvim" - }, - config = function() require('telescope').setup({}) - + local search = require('search') local builtin = require('telescope.builtin') - vim.keymap.set('n', 'pf', builtin.find_files, {}) - vim.keymap.set('n', '', builtin.git_files, {}) + + search.setup({ + mappings = { -- optional: configure the mappings for switching tabs (will be set in normal and insert mode(!)) + next = '', + prev = '' + }, + append_tabs = { -- append_tabs will add the provided tabs to the default ones + { + 'Commits', -- or name = "Commits" + builtin.git_commits, -- or tele_func = require('telescope.builtin').git_commits + available = function() -- optional + return vim.fn.isdirectory('.git') == 1 + end + }, + }, + }) + + vim.keymap.set('n', 'pf', search.open, {}) vim.keymap.set('n', 'pws', function() local word = vim.fn.expand("") builtin.grep_string({ search = word }) @@ -27,4 +43,3 @@ return { vim.keymap.set('n', 'vh', builtin.help_tags, {}) end } -