If it's a longer sub or if block, and I'm at the closing }, I can hit % in vi, and it takes me to the matching one. If it's on the same line, I see the sub name or conditional on the screen, which is _exactly_ what I want. If it's on the next line, I have to then scroll up a line to see, and the next thing I'm usually going to want to do after seeing that is % back to the end brace (to go back to where I was.) So, it annoys me to no end when people put them on the next line.
Can't you just rebind the % key so that (in addition
to what it usually does) it checks that the line it
is on is not the first or last line in the buffer,
scrolling one line if necessary to accomplish that?
vim fans claim it's pretty customizable, so one
would think that would be easy (though, not being a
vi user myself, I'm speculating here).
(Of course, I prefer the behavior wherein the editor
shows the line containing the opening brace in the
status area when your cursor rests after the closing
brace, so you don't have to hit a key in the first
place, which brings us back to your argument, since
there's not room in the status area for two lines
without expanding it, which is a bit jarring.)
My own reason for preferring nestled braces in most
cases is that it makes the code significantly more
vertically compact, which allows a lot more context
to fit on the screen at once, making the code easier
to follow, since you can see more with less scrolling
about.
"In adjectives, with the addition of inflectional endings, a changeable long vowel (Qamets or Tsere) in an open, propretonic syllable will reduce to Vocal Shewa. This type of change occurs when the open, pretonic syllable of the masculine singular adjective becomes propretonic with the addition of inflectional endings."
— Pratico & Van Pelt, BBHG, p68
| [reply] |
| [reply] |