local status, telescope = pcall(require, 'telescope')
if (not status) then return end

-- Configure.
telescope.setup {
	defaults = {
		file_ignore_patterns = {
			'.git',
			'node_modules',
			'dist',
			'static',
			'public'
		}
	}
}

-- See `:help telescope.builtin`
local builtin = require('telescope.builtin')

-- Search.
vim.keymap.set('n', '<leader>sf', builtin.find_files)
vim.keymap.set('n', '<leader>sw', builtin.grep_string)
vim.keymap.set('n', '<leader>sg', builtin.live_grep)

-- Old files.
vim.keymap.set('n', '<leader>?', builtin.oldfiles)

-- Search current buffer.
-- vim.keymap.set('n', '<leader>/', function()
-- 	builtin.current_buffer_fuzzy_find(require('telescope.themes').get_dropdown {
-- 		winblend = 10,
-- 		previewer = false,
-- 	})
-- end)
