3 ms·
> =% Yikes. I've been using vi forever and that never occurred to me. I just tried it on my own config and it works just as you say. I hope it is configurable,
by ksaj 7y ago
> =%
Yikes. I've been using vi forever and that never occurred to me. I just tried it on my own config and it works just as you say. I hope it is configurable, 'cos it doesn't fully agree with my habits (although maybe that's a fault of my own, and not vi(m)'s!)
Best thing about HN comment threads is that these gems keep happening.
- kazinator 7y agoI used that on C code before Lisp: jump from { to } or vice versa, while reindenting. Whether you get this alignment: (oper args blah blah) or this one: (fun arg arg arg arg) depends on one very simple configuration: the lispwords variable. All the identifiers listed in lispwords are given the former treatment. Then there are minor squabbles like what happens with the t clause in cond. A lot of the time I just use visual select and =. Also, in Vim, when you reindent multiple lines, it basically assumes that the first one is indented right; it will not move it relative to it predecessors. You often have to hit == on the first line to get it into alignment, and then %= (or whatever) to reindent the range below it. E.g.: (let ((x y)) (blah ;; here we type == blah blah (foo bar boo)) (let ((x y)) (blah ;; now %= blah blah (foo bar boo)) (let ((x y)) (blah blah blah (foo bar boo))