https://github.com/otavioschwanck/ruby-toolkit.nvim
Ruby tools for neovim
https://github.com/otavioschwanck/ruby-toolkit.nvim
Last synced: 5 months ago
JSON representation
Ruby tools for neovim
- Host: GitHub
- URL: https://github.com/otavioschwanck/ruby-toolkit.nvim
- Owner: otavioschwanck
- License: mit
- Created: 2023-02-21T01:42:31.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-03-06T09:42:17.000Z (about 1 year ago)
- Last Synced: 2024-08-07T18:35:22.292Z (8 months ago)
- Language: Lua
- Size: 8.79 KB
- Stars: 18
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- stars - otavioschwanck/ruby-toolkit.nvim - Ruby tools for neovim (Lua)
README
# Ruby Toolkit
Refactoring tools for Ruby and Ruby on rails.
- [Ruby Toolkit](#ruby-toolkit)
- [Demo](#demo)
- [Extract Function](#extract-function)
- [Create function from word](#create-function-from-word)
- [Extract Variable](#extract-variable)
- [Dependencies](#dependencies)
- [Installation](#installation)
- [Packer](#packer)
- [Roadmap](#roadmap)# Demo
## Extract Function
## Create function from word
## Extract Variable
# Dependencies
- [nvim-treesitter](https://github.com/nvim-treesitter/nvim-treesitter)
- [nvim-treesitter-textobjects](https://github.com/nvim-treesitter/nvim-treesitter-textobjects)# Installation
## Packer
```lua
{ 'otavioschwanck/ruby-toolkit.nvim', requires = { "nvim-treesitter/nvim-treesitter", "nvim-treesitter/nvim-treesitter-textobjects" }, config = function()
vim.keymap.set("n", "mv", "lua require('ruby-toolkit').extract_variable()")
vim.keymap.set("v", "mf", "lua require('ruby-toolkit').extract_to_function()")
vim.keymap.set("n", "mf", "lua require('ruby-toolkit').create_function_from_text()")
end}
```## Lazy
```lua
{ 'otavioschwanck/ruby-toolkit.nvim', dependencies = { "nvim-treesitter/nvim-treesitter", "nvim-treesitter/nvim-treesitter-textobjects" }, keys = {
{ "mv", "lua require('ruby-toolkit').extract_variable()", desc = "Extract Variable", mode = { "v" } },
{ "mf", "lua require('ruby-toolkit').extract_to_function()", desc = "Extract To Function", mode = { "v" } },
{ "mf", "lua require('ruby-toolkit').create_function_from_text()", desc = "Create Function from item on cursor" },
} },
```# Roadmap
- Telescope rails routes / insert routes / go to route controller.
- Rails i18n search / insert.