Skip to content

lucaseras/ruby-rocketifier.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

ruby-rocketifier.nvim

Hash rockets ↔ Hash colons

Why?

In Ruby, sometimes you want to transform hashes from using hash rockets:

{
  'foo' => 0, 
  'bar' => 1, 
  'baz' => 2,
}

To the newer symbol syntax:

{
  foo: 0,
  bar: 1,
  baz: 2,
}

After doing this by hand enough times, I decided to create a simple Neovim plugin to do it for me!

How?

Use your favorite package control system! Using Plug as an example:

call plug#begin('~/.local/share/nvim/plugged')
 Plug 'lucaseras/ruby-rocketifier.nvim'
call plug#end()

Then, all you need to do is initialize the plugin using require('ruby-rocketifier').setup({})

You can define your own keymaps like so:

require('ruby-rocketifier').setup({
  keymaps = {
    to_rocket = false,
    to_colon = false,
    toggle = "<leader>l",
  }
})

Keymaps set to false don't get set.

About

Hash rockets ↔ hash colons

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages