GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - jdrupal-dev/code-refactor.nvim: A collection of nifty neovim code actions

BranchesTags
Open more actions menu

Latest commit

 

History

17 Commits
17 Commits

Folders and files

NameName
Last commit message
Last commit date
lua
lua
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
stylua.toml
stylua.toml
 
 

Repository files navigation

code-refactor.nvim

code-refactor.nvim a collection of nifty code actions that do not require a LSP.

Screen.Recording.2024-01-29.at.9.56.03.mov

🔒 Requirements

  • nvim-treesitter

📦 Installation

Install this plugin using your favorite plugin manager, and then call require("code-refactor").setup().

lazy.nvim

{
    "jdrupal-dev/code-refactor.nvim",
    dependencies = { "nvim-treesitter/nvim-treesitter" },
    keys = {
        { "<leader>cc", "<cmd>CodeActions all<CR>", desc = "Show code-refactor.nvim (not LSP code actions)" },
    },
    config = function()
        require("code-refactor").setup({
            -- Configuration here, or leave empty to use defaults.
        })
    end
}

🚀 Usage

Run the :CodeActions all command to show a select list of available actions under the cursor.

Run :CodeActions [x] to run a specific code action.
For example: :CodeActions toggle_arrow_function_braces.

⚙️ Configuration

The default configuration is found in lua/code-refactor/config.lua.
Simply call require("code-refactor").setup with the desired options.

To disable code actions for any given language, simply return an empty table in file_types.

require("code-refactor").setup({
    available_actions = {
        javascript = {
            file_types = {},
        },
    },
})

✨ Available actions

Name JavaScript PHP
General
Flip ternary yes yes
Negate expression yes yes
Convert arrow function yes yes
JavaScript
Toggle arrow function braces yes

About

A collection of nifty neovim code actions

Topics

code-actionneovim-pluginrefactoring

Resources

Readme
MIT license
Activity

Stars

21 stars

Watchers

1 watching

Forks

2 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.