This Neovim plugin automatically inserts end after writing def, class, module, or do in Ruby files. The cursor is positioned correctly for writing the method, class, or block body.
Detects def, class, module, and do statements.
Inserts an indented end after pressing . Moves the cursor to the correct indentation level inside the block.
Supports Vim's indentation settings (spaces or tabs).
Using Lazy.nvim
{
"pvfm/ruby_auto_end.nvim",
}
Using Packer.nvim
use({
"pvfm/ruby_auto_end.nvim",
})
The plugin automatically works for Ruby files. When you type def
, class
, module
, or do
and press <CR>
, it will:
- Insert an empty indented line.
- Insert
end
properly indented. - Position the cursor inside the block.
def my_method
class my_class
def my_method
# Cursor is here, ready to type
end
class my_class
# Cursor is here, ready to type
end
This plugin is open-source and licensed under the MIT License.
Feel free to submit issues or pull requests!