Skip to content

[idea] Wire snacks.nvim's rename module for LSP-aware file rename #320

Description

@stanfish06

What

snacks.nvim is already a core dependency (plugin_config.lua configures its scroll, bigfile, indent, and notifier modules), but its rename module is unconfigured. Snacks.rename hooks LSP's workspace/willRenameFiles so that renaming a file on disk automatically updates import/require paths referencing it across the project.

Where

lua/config/plugin_config.lua — the existing snacks.setup({...}) call (around line 388) would need a rename = { enabled = true } (or equivalent) entry, plus a command/keymap wired to Snacks.rename.rename_file().

Why it matters

This is deliberately not the same as #275 (generic filetree create/rename/delete operations, which is about basic filesystem ops in the custom floating filetree UI) — this is the LSP-reference-fixing layer underneath a rename, usable standalone right now (e.g. via a :RenameFile command or keymap) independent of any filetree UI work, and would compose naturally with #275 later if/when that lands.

Recommended action

Add a minimal rename config block to the existing snacks.setup() call in plugin_config.lua, plus a user command (e.g. :SnacksRename) or keymap that calls Snacks.rename.rename_file(), prompting for a new path via vim.ui.input.

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