vim

For discussion on all things (neo)vim.
Chase 2020-07-03T17:52:30.344300Z

I like to line up things like let bindings and such, purely for silly, aesthetic reasons. So I'll add a space or two here and there to make them all line up if possible. Is there a way to help partially automate this? Like I highlight the code block and hit a command, it lines them up.

👍 1
😧 1
Fortino Gutierrez 2020-07-03T18:15:54.344900Z

Not shure if this what you are looking for but this plugin helps with tab alignment https://github.com/junegunn/vim-easy-align and you can map it like this

map <C-a> gai{<Space><CR>
this will align maps

Fortino Gutierrez 2020-07-03T18:17:14.345200Z

it can turn

{:a "hi"
 :long "hi}
to
{:a    "hi"
 :long "hi}