aboutsummaryrefslogtreecommitdiffstats
path: root/plugin/50-fzf-lua.lua
blob: 2275a2da160faee36fc3cc9196c8336ec1d60426 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
--
-- Fuzzy finder configuration (files, grep, buffers, help)
--
-- See https://github.com/ibhagwan/fzf-lua

-- Avoid conflicts with the already existing fzf configuration at ~/.config/fzf/fzf.bash
vim.env.FZF_DEFAULT_OPTS = nil

vim.pack.add({
	"https://github.com/nvim-tree/nvim-web-devicons", -- File-type icons (also used by lualine)
	"https://github.com/ibhagwan/fzf-lua",
})

local fzf = require("fzf-lua")

fzf.setup({})

vim.keymap.set("n", "<Leader>ff", fzf.files, { desc = "Find files" })
vim.keymap.set("n", "<Leader>fg", fzf.live_grep, { desc = "Find by grep (live)" })
vim.keymap.set("n", "<Leader>fb", fzf.buffers, { desc = "Find buffers" })
vim.keymap.set("n", "<Leader>fh", fzf.helptags, { desc = "Find help tags" })
vim.keymap.set("n", "<Leader>fr", fzf.resume, { desc = "Resume last picker" })