summaryrefslogtreecommitdiff
path: root/dot_config/nvim/lua/plugins/telescope.lua
blob: bc760dee00daa198b8bc9da54f9f09ffb8a4c260 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
local function gen(key, fn, desc)
	return {'<leader>f' .. key,
			function()
				require 'telescope.builtin'[fn]()
			end,
			desc = desc}
end

return {
	{
		'nvim-telescope/telescope.nvim',
		dependencies = {
			'nvim-lua/plenary.nvim',
			{
				'nvim-telescope/telescope-fzf-native.nvim',
				build = 'make',
			},
		},
		config = function(_, opts)
			local ts = require 'telescope'
			ts.setup(opts)
			ts.load_extension 'fzf'
		end,
		cmd  = 'Telescope',
		keys = {
			gen('f', 'find_files', 'Find File'),
			gen('g', 'live_grep',  'Live Grep'),
			gen('b', 'buffers',    'Find Buffer'),
			gen('h', 'help_tags',  'Find Help'),
			gen('c', 'commands',   'Find Command'),
			gen('t', 'treesitter', 'Find Treesitter'),
		},
	},
}