My Neovim Plugins #2 — code-refactor.lua
The second plugin I want to show is code-refactor.lua. Which is a neat little helper for JS/TS Projects without the need for an LSP.
Config
return {
"jdrupal-dev/code-refactor.nvim",
dependencies = { "nvim-treesitter/nvim-treesitter" },
keys = {
{ "<leader>a", "<cmd>CodeActions all<CR>", desc = "Show code-refactor.nvim (not LSP code actions)" },
},
config = function()
require("code-refactor").setup()
end,
}
The config is nothing special. Just changed the key to <leader>a
. Which opens a small floating window with possible code-actions.
Because I work 99% of the time in a React.js environment where arrow functions are used everywhere, it is handy to have a code action where I can toggle it into a normal function.
70 of #100DaysToOffload
Thoughts? Discuss...