Fork me on GitHub
#vim
<
2020-07-03
>
Chase17:07:30

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.

😧 3
👍 3
Fortino Gutierrez18:07:54

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 Gutierrez18:07:14

it can turn

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

Chase00:07:31

I think that is exactly what I was searching for, thank you. Not sure which lazy side will win out now that I try it, not wanting to learn a new plugin/tool for the limited times I do it or the lazy side that was looking for the shortcut in the first place. haha