vim 技巧在 Ruby 中对齐块/结束关键字?

发布于 2024-09-04 15:20:18 字数 78 浏览 2 评论 0原文

有没有办法简单地让我的块及其结束关键字与 vim 正确对齐?如果我有一个嵌套了多个条件的函数,事情可能会很快变得丑陋。 Vim 能拯救世界吗?

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 several conditions, things can start to get ugly fast. Can vim save the day?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

早乙女 2024-09-11 15:20:18

当然。只需选择相关的代码块并按 =

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

×眷恋的温暖 2024-09-11 15:20:18

还有一个名为 endwise 的不错的 Vim 插件,它会自动插入你。

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

花期渐远 2024-09-11 15:20:18
gg=G

(转到顶部,重新缩进到底部)

gg=G

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文