I wrote a neovim plugin called splitjoin.nvim to handle a common task when editing code: splitting and joining lists. The plugin is inspired by the venerable old vim-mode-plus and takes the place of the older, more established, but envimscriptened SplitJoin.vim by Andrew Radev.
Install it with lazy.nvim
return { 'bennypowers/splitjoin.nvim',
lazy = true,
keys = {
{ 'gj', function() require'splitjoin'.join() end, desc = 'Join the object under cursor' },
{ 'g,', function() require'splitjoin'.split() end, desc = 'Split the object under cursor' },
},
opts = {
-- default_indent = ' ' -- default is two spaces
},
}
Give it a whirl and LMK what you think. If you like it, I'd be happy if you left a ⭐ on the GitHub repo.