Fork me on GitHub
#emacs
<
2015-09-23
>
upgradingdave11:09:51

Hey all, does anyone know of a emacs command to format sexps so they’re lined up by columns? So for example, an easy way to transform something like this:

upgradingdave11:09:06

into something like this?

upgradingdave12:09:31

nm, got it working with C-u M-x align-regexp \(\s-+\) 1 1 Y

redbeardymcgee12:09:28

you probably didn't need to mess with align-regexp but if it works it works

redbeardymcgee12:09:10

M-x align might have done it by default, maybe not. my dev vm isn't open to test.

upgradingdave12:09:24

thanks @redbeardymcgee, align didn’t work for me (it could be something in my .emacs.d setup though), align gives me:

upgradingdave13:09:37

yeah, maybe something is causing strangeness in my setup then, thanks

redbeardymcgee13:09:51

perhaps it needed the prefix also

upgradingdave13:09:23

Tried C-u M-x align and no dice unfortunately 😕

upgradingdave13:09:36

But, the good news is this is working nicely for me:

upgradingdave13:09:19

That’s 20 mins of my life I’ll never get back 😅

upgradingdave13:09:58

… but then again, I’ll probably save > 20 mins not having to manually align things 😉

redbeardymcgee13:09:13

this sees like the kind of thing some variant of align would just DWIM

redbeardymcgee13:09:35

Pretty strange that it doesn't

colin.yates18:09:50

(it works for much more than just ‘let’ forms)

colin.yates18:09:04

Is there an elegant solution that allows me to have multiple terminals in Emacs? On OSX I frequently run the Emacs.app fullscreen but then have to swipe for my various ‘lein’ processes.

dottedmag18:09:01

C-u M-x shell, or am I missing something?

colin.yates18:09:54

You might be missing my newbie-ness simple_smile. I did try that but I got an exception about specifying a prefix arg before helm-M-x

nooga18:09:22

@colin.yates: I think we should move it here

colin.yates18:09:14

having said that, I need to run for tea soon. I will say though, that I didn’t really get yak-shaving until I started with my own config.

nooga18:09:28

my other poblem is that I can’t use vanilla emacs or any other emacs that isn’t e-l

nooga18:09:40

because almost all keybindings are different

nooga18:09:28

@colin.yates: I see what you mean! Have a nice one then

dottedmag18:09:36

@colin.yates: Well, no idea about helm

colin.yates18:09:06

So is C-u idiomatic emacs for ‘more than one’?

colin.yates18:09:20

(I wasn’t kidding about the newbie…)

dottedmag18:09:59

Not terribly useful either :-/

dottedmag18:09:17

So, every command has an argument. A number or nothing.

dottedmag18:09:36

C-u is equivalent of supplying argument 4. C-1 C-0 C-0 is supplying 100

dottedmag18:09:41

C-u C-u supplies 16

dottedmag18:09:25

Etc. Many commands interpret it as a "alternative way" of doing things -- often by asking more questions or executing command differently.

colin.yates18:09:09

would people recommend SpaceMacs with the vi emulation for a non-vi user? :wq and ‘i’ are about the limit of my vi skills simple_smile, but I hear good things about SpaceMacs+Space leader just from a usability perspective….

nooga19:09:38

it looks cool for sure

nooga19:09:59

but it’s not for me

nooga19:09:12

modal editing is hard

redbeardymcgee19:09:45

i learned a good bit of vim over ~3 years, but i never liked the modal editing

beppu20:09:15

I've been using vim for over a decade, but lisp support in Emacs is more mature, so I switch to emacs for Clojure development.