Skip to content

[plugins] flash.nvim and grug-far.nvim — navigation and project-wide replace #287

Description

@stanfish06

What

Two well-maintained plugins that fill gaps in the current setup without overlapping anything already installed.


flash.nvim — folke/flash.nvim

Rationale: vim-sneak (installed as sneaks.vim) provides 2-char forward/backward seek with label mode. flash.nvim is the modern successor pattern: same core motion but with Treesitter-aware jumping (jump directly to a specific AST node), remote operations (yr to yank remote without moving), and first-class f/t/F/T enhancement. The existing plugin_config.lua already remaps f/F/t/T to Sneak variants — flash.nvim can take over those same bindings and do strictly more.

Key additions over vim-sneak:

  • Treesitter jump mode (<C-s> in operator-pending: picks by node type)
  • Remote flash (r in operator-pending: apply op at a remote location without moving)
  • Search enhancement (jump directly from / results with labels)
  • Maintained and Neovim-native (Lua, no Vimscript)

Migration is low-risk: replace the f/F/t/T remaps in plugin_config.lua with flash equivalents and remove vim-sneak from package_list.


grug-far.nvim — MagicDuck/grug-far.nvim

Rationale: The current setup has excellent search (fzf.live_grep, fzf.files) but no project-wide replace tool. :s///g is buffer-local; the quickfix + cfdo workflow works but is manual. grug-far.nvim opens a buffer-based live search-and-replace backed by rg (which is already required for fzf.live_grep), lets you edit matches inline, and syncs changes back to their source files. It slots directly into the existing <leader>g* git and <leader>/ grep keyspace.

Suggested keymap:

vim.keymap.set({"n","v"}, "<leader>sr", "<cmd>GrugFar<CR>", { desc = "Search and replace (project)" })
vim.keymap.set("n", "<leader>sR", function()
    require("grug-far").open({ prefills = { search = vim.fn.expand("<cword>") } })
end, { desc = "Search and replace (word under cursor)" })

No conflicts with existing keymaps.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions