No description
- Lua 100%
| lua/rephrase | ||
| .luarc.json.c | ||
| README.md | ||
nvim-rephrase
LSP rename with a live preview. Changes are reflected across all visible occurrences as you type.
Requires an LSP that supports textDocument/rename, only tested on Neovim 0.12+.
Installation
lazy.nvim
{
"LarssonMartin1998/nvim-rephrase",
opts = {},
keys = {
{ "grn", "<cmd>Rephrase<cr>" },
},
}
vim.pack
vim.pack.add({
"https://github.com/LarssonMartin1998/nvim-rephrase",
})
require("rephrase").setup({})
vim.keymap.set("n", "grn", "<cmd>Rephrase<cr>", {})
Default keys inside the float:
| Key | Action |
|---|---|
<CR> / <C-j> |
Submit rename |
<Esc> / q |
Cancel |
Configuration
Default config:
require("rephrase").setup({
-- Open the float with an empty input instead of pre-filling the current word.
open_empty = {
enabled = false,
-- When open_empty is enabled, also start the live preview with nothing
-- substituted, so the original word remains visible until you start typing.
start_live_preview_empty = true,
},
-- Mode to enter when the float opens.
-- rephrase.StartMode.NORMAL | INSERT | SELECT
start_mode = require("rephrase").StartMode.SELECT,
-- Where to place the cursor inside the float.
-- rephrase.CursorPos.START | END | KEEP
-- KEEP preserves your offset within the word at the time of invocation.
cursor_pos = require("rephrase").CursorPos.START,
})