https://github.com/javiorfo/nvim-renamid
Neovim plugin for LSP rename function in a centered popup
https://github.com/javiorfo/nvim-renamid
neovim neovim-lsp neovim-plugin popupwindow rename
Last synced: 5 months ago
JSON representation
Neovim plugin for LSP rename function in a centered popup
- Host: GitHub
- URL: https://github.com/javiorfo/nvim-renamid
- Owner: javiorfo
- License: other
- Created: 2024-04-17T14:10:46.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-08-14T02:24:03.000Z (about 1 year ago)
- Last Synced: 2024-08-14T03:59:43.310Z (about 1 year ago)
- Topics: neovim, neovim-lsp, neovim-plugin, popupwindow, rename
- Language: Lua
- Homepage:
- Size: 17.6 KB
- Stars: 6
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# nvim-renamid
### Rename in the mid
*Neovim plugin for LSP rename function in a popup*## Caveats
- This is available only using configured LSP languages
- This plugin has been developed on and for Linux following open source philosophy.## Installation
`Packer`
```lua
use {
'javiorfo/nvim-renamid',
requires = { 'javiorfo/nvim-popcorn' }
}
```
`Lazy`
```lua
{
'javiorfo/nvim-renamid',
dependencies = { 'javiorfo/nvim-popcorn' }
lazy = true,
ft = { "c", "java", "rust" }, -- LSP languages
opts = {
-- This is optional. Only If you want to change default configurations
-- Width of popup. Default value 30
width = 30,
-- Title of popup. Default value "Rename".
-- The second value is a link to a highlight keyword. Default "Boolean" keyword hightlight link
title = { "Rename", "Boolean" },
-- Border of popup. Default value "rounded_corners_border".
-- Other borders: "simple_border", "simple_thick_border", "double_border", "double_simple_border"
border = "rounded_corners_border"
}
}
```## Configuration
#### For Packer, Lazy.nvim is above
```lua
require'renamid'.setup {
-- This is optional. Only If you want to change default configurations
-- Width of popup. Default value 30
width = 30,
-- Title of popup. Default value "Rename".
-- The second value is a link to a highlight keyword. Default "Boolean" keyword hightlight link
title = { "Rename", "Boolean" },
-- Border of popup. Default value "rounded_corners_border".
-- Other borders: "simple_border", "simple_thick_border", "double_border", "double_simple_border"
border = "rounded_corners_border"
}
```## Usage
- Assuming LSP rename is configured like this:
```lua
-- Usual LSP rename mapping
{ 'rn', 'lua vim.lsp.buf.rename()' }-- Replace the line above with this:
{ 'rn', ':Renamid' },
```
- A centered popup will be opened with the word behind the cursor in *INSERT MODE*, so you can edit it an press `` to make the change take effect. Double `` to close the popup without changes.## Screenshots
### Simple use
**NOTE:** The colorscheme **nox** from [nvim-nyctophilia](https://github.com/javiorfo/nvim-nyctophilia) is used in this image.
---
### Donate
- **Bitcoin** [(QR)](https://raw.githubusercontent.com/javiorfo/img/master/crypto/bitcoin.png) `1GqdJ63RDPE4eJKujHi166FAyigvHu5R7v`
- [Paypal](https://www.paypal.com/donate/?hosted_button_id=FA7SGLSCT2H8G)