Giter VIP home page Giter VIP logo

nvim-renamid's Introduction

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

use {
    'javiorfo/nvim-renamid',
    requires = { 'javiorfo/nvim-popcorn' }
}

Lazy

{ 
    '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

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:
-- Usual LSP rename mapping
{ '<leader>rn', '<cmd>lua vim.lsp.buf.rename()<CR>' }

-- Replace the line above with this:
{ '<leader>rn', '<cmd>:Renamid<CR>' },
  • A centered popup will be opened with the word behind the cursor in INSERT MODE, so you can edit it an press <CR> to make the change take effect. Double <ESC> to close the popup without changes.

Screenshots

Simple use

renamid

NOTE: The colorscheme nox from nvim-nyctophilia is used in this image.


Donate

  • Bitcoin (QR) 1GqdJ63RDPE4eJKujHi166FAyigvHu5R7v
  • Paypal

nvim-renamid's People

Contributors

javiorfo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.