From b5dabd49f1bd35122673c568c11ca211779fd337 Mon Sep 17 00:00:00 2001 From: Ruslan Date: Tue, 21 Jul 2026 12:10:34 +0300 Subject: [PATCH] refactor(telescope): formatting --- lua/crentist/lazy/telescope.lua | 160 ++++++++++++++++---------------- 1 file changed, 80 insertions(+), 80 deletions(-) diff --git a/lua/crentist/lazy/telescope.lua b/lua/crentist/lazy/telescope.lua index 5d6222b..2a7483a 100644 --- a/lua/crentist/lazy/telescope.lua +++ b/lua/crentist/lazy/telescope.lua @@ -1,91 +1,91 @@ return { - 'FabianWirth/search.nvim', - dependencies = { - 'nvim-lua/plenary.nvim', - { - 'nvim-telescope/telescope.nvim', - dependencies = { - { 'nvim-telescope/telescope-fzf-native.nvim', build = 'make' } - } - }, + 'FabianWirth/search.nvim', + dependencies = { + 'nvim-lua/plenary.nvim', + { + 'nvim-telescope/telescope.nvim', + dependencies = { + { 'nvim-telescope/telescope-fzf-native.nvim', build = 'make' } + } }, + }, - config = function() - local telescope = require('telescope') - local telescopeConfig = require('telescope.config') + config = function() + local telescope = require('telescope') + local telescopeConfig = require('telescope.config') - local vimgrep_arguments = { unpack(telescopeConfig.values.vimgrep_arguments) } - table.insert(vimgrep_arguments, '--hidden') - table.insert(vimgrep_arguments, '--glob') - table.insert(vimgrep_arguments, '!**/.git/*') + local vimgrep_arguments = { unpack(telescopeConfig.values.vimgrep_arguments) } + table.insert(vimgrep_arguments, '--hidden') + table.insert(vimgrep_arguments, '--glob') + table.insert(vimgrep_arguments, '!**/.git/*') - telescope.setup({ - defaults = { - vimgrep_arguments = vimgrep_arguments, - file_ignore_patterns = { "^.git/" } - }, - extensions = { - fzf = {} - } - }) + telescope.setup({ + defaults = { + vimgrep_arguments = vimgrep_arguments, + file_ignore_patterns = { "^.git/" } + }, + extensions = { + fzf = {} + } + }) - telescope.load_extension('fzf') + telescope.load_extension('fzf') - local search = require('search') - local builtin = require('telescope.builtin') + local search = require('search') + local builtin = require('telescope.builtin') - search.setup({ - mappings = { -- optional: configure the mappings for switching tabs (will be set in normal and insert mode(!)) - next = '', - prev = '' - }, - tabs = { - { name = 'Files', tele_func = builtin.find_files, tele_opts = { no_ignore = false, hidden = true, } }, - { name = 'Advanced Grep', tele_func = require('crentist.telescope.advanced_grep').advanced_grep }, - { name = 'Buffers', tele_func = builtin.buffers }, - }, - 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 - }, - { - 'Stash', - builtin.git_stash, - available = function() - return vim.fn.isdirectory('.git') == 1 - end - }, - { - 'All files', - builtin.find_files, - tele_opts = { no_ignore = true, hidden = true }, - available = function() - return vim.fn.isdirectory('.git') == 1 - end - }, - }, - }) + search.setup({ + mappings = { -- optional: configure the mappings for switching tabs (will be set in normal and insert mode(!)) + next = '', + prev = '' + }, + tabs = { + { name = 'Files', tele_func = builtin.find_files, tele_opts = { no_ignore = false, hidden = true, } }, + { name = 'Advanced Grep', tele_func = require('crentist.telescope.advanced_grep').advanced_grep }, + { name = 'Buffers', tele_func = builtin.buffers }, + }, + 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 + }, + { + 'Stash', + builtin.git_stash, + available = function() + return vim.fn.isdirectory('.git') == 1 + end + }, + { + 'All files', + builtin.find_files, + tele_opts = { no_ignore = true, hidden = true }, + available = function() + return vim.fn.isdirectory('.git') == 1 + end + }, + }, + }) - vim.keymap.set('n', 'pf', search.open, {}) - vim.keymap.set('n', 'pb', function() - search.open({ tab_name = 'Buffers' }) - end) - vim.keymap.set('n', 'pws', function() - local word = vim.fn.expand('') - builtin.grep_string({ search = word }) - end) - vim.keymap.set('n', 'pWs', function() - local word = vim.fn.expand('') - builtin.grep_string({ search = word }) - end) - vim.keymap.set('n', 'ps', function() - builtin.grep_string({ search = vim.fn.input('Grep > ') }) - end) - vim.keymap.set('n', 'vh', builtin.help_tags, {}) - end + vim.keymap.set('n', 'pf', search.open, {}) + vim.keymap.set('n', 'pb', function() + search.open({ tab_name = 'Buffers' }) + end) + vim.keymap.set('n', 'pws', function() + local word = vim.fn.expand('') + builtin.grep_string({ search = word }) + end) + vim.keymap.set('n', 'pWs', function() + local word = vim.fn.expand('') + builtin.grep_string({ search = word }) + end) + vim.keymap.set('n', 'ps', function() + builtin.grep_string({ search = vim.fn.input('Grep > ') }) + end) + vim.keymap.set('n', 'vh', builtin.help_tags, {}) + end }