Vim trick for aligning keywords / end words in Ruby?

Is there a way to just make my blocks and their closing completion keyword match vim correctly? If I have a function nested in several conditions, things can start quickly ugly. Is it possible to save day to day?

+3
source share
3 answers

Of course. Just select the appropriate code block and press =.

+12
source

There's also a nice Vim plugin called endwise that automatically inserts you ends.

+3
source
gg=G

(above, indent all the way down)

+3
source

Source: https://habr.com/ru/post/1749317/


All Articles