From 865b52c2e58d4724d4c279d9ec8859f0f88a28c4 Mon Sep 17 00:00:00 2001 From: Jonny Barnes Date: Sat, 8 Aug 2026 18:39:48 +0100 Subject: [PATCH] Add fzf-lua for project navigation Wraps the fzf binary already installed via brew, alongside rg and fd, so it needs no plugin dependencies - unlike telescope, which would also pull in plenary. Picks up nvim-web-devicons for file icons, which is the first thing actually using that plugin. Maps live under f: files, live grep, buffers, grep the word under the cursor, and help tags. The intent is to stop treating netrw as the way into a project and switch to jumping by name, leaving buffers open and bouncing between them, rather than quitting out of nvim to change file. Netrw is untouched and still on :Ex for browsing an unfamiliar tree. Co-Authored-By: Claude Opus 5 (1M context) --- neovim/config/plugins/fzf-lua.lua | 15 +++++++++++++++ neovim/config/plugins/init.lua | 1 + neovim/config/plugins/which-key.lua | 1 + neovim/nvim-pack-lock.json | 4 ++++ 4 files changed, 21 insertions(+) create mode 100644 neovim/config/plugins/fzf-lua.lua diff --git a/neovim/config/plugins/fzf-lua.lua b/neovim/config/plugins/fzf-lua.lua new file mode 100644 index 0000000..8b56161 --- /dev/null +++ b/neovim/config/plugins/fzf-lua.lua @@ -0,0 +1,15 @@ +vim.pack.add({ 'https://github.com/ibhagwan/fzf-lua' }) + +local fzf = require('fzf-lua') + +fzf.setup() + +local function map(lhs, rhs, desc) + vim.keymap.set('n', lhs, rhs, { desc = desc }) +end + +map('ff', fzf.files, 'Find files') +map('fg', fzf.live_grep, 'Grep project') +map('fb', fzf.buffers, 'Switch buffer') +map('fw', fzf.grep_cword, 'Grep word under cursor') +map('fh', fzf.helptags, 'Search help') diff --git a/neovim/config/plugins/init.lua b/neovim/config/plugins/init.lua index d3e6515..b9bcfe9 100644 --- a/neovim/config/plugins/init.lua +++ b/neovim/config/plugins/init.lua @@ -1,3 +1,4 @@ +require('config.plugins.fzf-lua') require('config.plugins.gitsigns') require('config.plugins.web-devicons') require('config.plugins.which-key') diff --git a/neovim/config/plugins/which-key.lua b/neovim/config/plugins/which-key.lua index 2b6bf9e..634bd35 100644 --- a/neovim/config/plugins/which-key.lua +++ b/neovim/config/plugins/which-key.lua @@ -7,6 +7,7 @@ wk.setup() -- Names for the prefixes, so the popup groups them sensibly wk.add({ { 'd', group = 'diagnostics' }, + { 'f', group = 'find' }, { 'h', group = 'hunks' }, { 't', group = 'toggles' }, }) diff --git a/neovim/nvim-pack-lock.json b/neovim/nvim-pack-lock.json index cb2f5a2..4fdde6e 100644 --- a/neovim/nvim-pack-lock.json +++ b/neovim/nvim-pack-lock.json @@ -1,5 +1,9 @@ { "plugins": { + "fzf-lua": { + "rev": "8671012a7b2a1648595952c655039d51fb301c14", + "src": "https://github.com/ibhagwan/fzf-lua" + }, "gitsigns.nvim": { "rev": "31d6fb2d618bca1482b9f274751ead5f03461408", "src": "https://github.com/lewis6991/gitsigns.nvim"