aboutsummaryrefslogtreecommitdiffstats
path: root/plugin/50-fzf-lua.lua
blob: 9e86ed1e59c0b897a92974a2ed20cab830fc5975 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
--
-- Fuzzy finder configuration (files, grep, buffers, help)
--
-- See https://github.com/ibhagwan/fzf-lua
-- Uses the `fzf` binary, `rg` for grep, `fd` for the files provider and `bat`
-- for previews -- all installed by `dotfiles sync`.

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" })