formatting

This commit is contained in:
2024-10-03 17:59:08 +03:00
parent 1a2df25f5e
commit 758322bd93

View File

@@ -1,31 +1,31 @@
return { return {
"FabianWirth/search.nvim", 'FabianWirth/search.nvim',
dependencies = { dependencies = {
"nvim-lua/plenary.nvim", 'nvim-lua/plenary.nvim',
"nvim-telescope/telescope.nvim", 'nvim-telescope/telescope.nvim',
}, },
version = "0.1.6", version = '0.1.6',
config = function() config = function()
local telescope = require('telescope') local telescope = require('telescope')
local telescopeConfig = require('telescope.config') local telescopeConfig = require('telescope.config')
local vimgrep_arguments = { unpack(telescopeConfig.values.vimgrep_arguments) } local vimgrep_arguments = { unpack(telescopeConfig.values.vimgrep_arguments) }
table.insert(vimgrep_arguments, "--hidden") table.insert(vimgrep_arguments, '--hidden')
table.insert(vimgrep_arguments, "--glob") table.insert(vimgrep_arguments, '--glob')
table.insert(vimgrep_arguments, "!**/.git/*") table.insert(vimgrep_arguments, '!**/.git/*')
telescope.setup({ telescope.setup({
defaults = { defaults = {
vimgrep_arguments = vimgrep_arguments, vimgrep_arguments = vimgrep_arguments,
file_ignore_patterns = { file_ignore_patterns = {
"node_modules", 'node_modules',
} }
}, },
pickers = { pickers = {
find_files = { find_files = {
find_command = { "rg", "--files", "--hidden", "--glob", "!**/.git/*" }, find_command = { 'rg', '--files', '--hidden', '--glob', '!**/.git/*' },
} }
} }
}) })
@@ -45,7 +45,7 @@ return {
}, },
append_tabs = { -- append_tabs will add the provided tabs to the default ones append_tabs = { -- append_tabs will add the provided tabs to the default ones
{ {
'Commits', -- or name = "Commits" 'Commits', -- or name = 'Commits'
builtin.git_commits, -- or tele_func = require('telescope.builtin').git_commits builtin.git_commits, -- or tele_func = require('telescope.builtin').git_commits
available = function() -- optional available = function() -- optional
return vim.fn.isdirectory('.git') == 1 return vim.fn.isdirectory('.git') == 1
@@ -59,16 +59,17 @@ return {
search.open({ tab_name = 'Buffers' }) search.open({ tab_name = 'Buffers' })
end) end)
vim.keymap.set('n', '<leader>pws', function() vim.keymap.set('n', '<leader>pws', function()
local word = vim.fn.expand("<cword>") local word = vim.fn.expand('<cword>')
builtin.grep_string({ search = word }) builtin.grep_string({ search = word })
end) end)
vim.keymap.set('n', '<leader>pWs', function() vim.keymap.set('n', '<leader>pWs', function()
local word = vim.fn.expand("<cWORD>") local word = vim.fn.expand('<cWORD>')
builtin.grep_string({ search = word }) builtin.grep_string({ search = word })
end) end)
vim.keymap.set('n', '<leader>ps', function() vim.keymap.set('n', '<leader>ps', function()
builtin.grep_string({ search = vim.fn.input("Grep > ") }) builtin.grep_string({ search = vim.fn.input('Grep > ') })
end) end)
vim.keymap.set('n', '<leader>vh', builtin.help_tags, {}) vim.keymap.set('n', '<leader>vh', builtin.help_tags, {})
end end
} }