4 ms·
If you happen to be using VS Code for Ruby, https://code.visualstudio.com/updates/v1_14#_auto-indent-on-type-move-lines-and-paste https://code.visualstudio.com/
by dbattaglia 9y ago
If you happen to be using VS Code for Ruby, https://code.visualstudio.com/updates/v1_14#_auto-indent-on-type-move-lines-and-paste https://code.visualstudio.com/updates/v1_14#_auto-indent-on-... is a game changer.
Basically, when you type "end" it will automatically indent it for you, the same way it does for curly braces on C style languages. Seems like a small thing but it's fairly maddening after a while having to press shift+tab or return after typing "end".
- jug 9y agoAlso a god send for Visual Basic developers doing their "End If", "End Function", not to mention "End Sub". :D
- dbattaglia 9y agoExactly... Life's already hard enough on them as it is. :)
- piaste 9y agoVB dev here: We don't actually type those, Visual Studio adds them automatically when we hit enter. But we appreciate the thought, and we're happy that Ruby is halfway there now :)
- dbattaglia 9y agoExactly, regular Visual Studio has done this forever, but Visual Studio Code acted poorly on any language that uses words as block delimiters. As someone who's done C# and VB for well over 10 years before Ruby I definitely miss a lot about regular Visual Studio. It's nice to see VS Code evolving into a solid alternative for non Windows users while staying light and lean at the same time.
- rezistik 9y agoNo editor seems to handle ruby very well, why do I get an automatic closing bracket but no automatic end? I don't have to write a 1 char closing bracket why do I need to write a 3 char end?
- kwood 9y agoYou don't have to type "end". Shameless self plug: I wrote an extension that closes everything automatically, inspired by a plugin for vim with the same name: endwise[1] It's not 100% done yet, support for other languages is still missing. But it works. [1]: https://marketplace.visualstudio.com/items?itemName=kaiwood.endwise https://marketplace.visualstudio.com/items?itemName=kaiwood....
- dbattaglia 9y agoThis is great! Really helps fill one of the most annoying gaps in writing Ruby compared to, say, C# in full Visual Studio.
- papa-whisky 9y agoSuper handy, thanks for this!
- rezistik 9y agoThank you!
- lazarus101 9y agohttps://github.com/tpope/vim-endwise https://github.com/tpope/vim-endwise
- deleted 9y ago[deleted]
- tonerdo 9y agoAnyone have any idea what theme they use in the gif that demonstrates the ruby auto-indent feature?
- mattbierner 9y agoI believe it's One Dark Pro: https://marketplace.visualstudio.com/items?itemName=zhuangtongfa.Material-theme https://marketplace.visualstudio.com/items?itemName=zhuangto...
- dbattaglia 9y agoI've been using "Atom One Dark" which is also pretty similar https://marketplace.visualstudio.com/items?itemName=akamud.vscode-theme-onedark https://marketplace.visualstudio.com/items?itemName=akamud.v...
- jamesgeck0 9y agoI'd also like to know the name of the theme in the "Manage your .gitignore file" section. https://code.visualstudio.com/images/1_14_gitignore.gif https://code.visualstudio.com/images/1_14_gitignore.gif
- konart 9y agoAs a Sublime user - I was quite suprised when I tried VS Code and learned it couldn't do this. Now, if only they improve highlighting. In sublime if you select variable - only variables with same name will be hightlighted. VS Code highlights all occurances of the said string. So if you have variable r for IO.Reader or something - al occurances of r will be highlighted.