开发者

vim trick to align blocks/end keywords in Ruby?

开发者 https://www.devze.com 2023-01-02 18:25 出处:网络
Is there a way to simply have my blocks and their closing end keyword align properly with vim? If I have a function which is nested with sever开发者_StackOverflow社区al conditions, things can start to

Is there a way to simply have my blocks and their closing end keyword align properly with vim? If I have a function which is nested with sever开发者_StackOverflow社区al conditions, things can start to get ugly fast. Can vim save the day?


Sure. Just select the relevant block of code and press =.


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


gg=G

(go to top, re-indent all the way down to the bottom)

0

精彩评论

暂无评论...
验证码 换一张
取 消