Fork me on GitHub
#spacemacs
<
2017-10-27
>
jumar07:10:33

I always have trouble to remember some keyboard shortcuts, especially for some cider modes - debugger, spec inspector, etc. Is there a way to show current key bindings, e.g. when in the middle of debugging a function to avoid going through https://cider.readthedocs.io/en/latest/debugging/?

orestis10:10:12

I have to say, Spacemacs + Cider is much more enjoyable than trying to set Cursive app with IntelliJ.

orestis10:10:04

However, I have this annoying thing that sometimes I want to get out of some mis-typed command and press ESC many times, then eventually all the windows will disappear and one buffer (usually cider-error) will take over my frame. Is there any way to get back to my previous windows arrangement?

eggsyntax14:10:14

@jumar yeah -- there's stuff under SPC h d. In particular, SPC h d b (describe-bindings) is the thing you're looking for. It's a bit overwhelming, though, so you might want to play with the other stuff in that section. Some modes use ? to show mode-specific bindings, but it's not consistent.

eggsyntax14:10:38

@orestis yeah, actually! winner-undo is exactly that, undo the last buffer/layout/window change.

eggsyntax14:10:28

Also SPC w m toggles maximize-buffer, so if you were taken to the full-frame state via maximize buffer, that'll often change you back to where you were.

eggsyntax14:10:58

Having an independent undo stack for UI changes is a kickass idea IMHO and I wish other tools would adopt the same thing 🙂

jumar14:10:05

@eggsyntax thanks for the tip. I guess that's the same as Emacs's C-h b. You're right that there's a sectoin about cider--debug-mode. However, that's not terribly useful:

eggsyntax14:10:51

Whoa, weird, never seen that one.

eggsyntax14:10:23

You know there's also a little thing in the buffer you're debugging that shows you the main commands? It can be easy to overlook; placement is often at the top of the fn you're debugging.

jumar14:10:54

Fabulous! I don't know how could I missed that. Thanks a ton.

eggsyntax14:10:43

eg n)ext, q)uit, l)ocals ...

orestis14:10:57

Thanks! I’ve starred this to keep track 🙂

eggsyntax15:10:40

magit question -- as mindblowing as magit is, I have one minor use case I keep tripping over -- sometimes I s)tage a hunk, only to realize it included something I didn't want to stage yet. So I have to go up to the filename, tab-collapse it, go to the staging section, tab-expand the same filename, and u)nstage it, then tab-collapse, go back to the unstaged section, tab-expand, and find the hunk again. Is there some way to just undo the last staging-action? Or some other quicker way to reverse the premature stage? Esp @ag since you've become our de facto magit expert 😉

ag15:10:36

I'm not sure exactly how to do that. It's probably possible. I bet you'd be interested to learn about so called wip modes https://magit.vc/manual/magit/Wip-Modes.html thought

eggsyntax15:10:07

I'll check it out (ha ha no punintended). Thanks!

jeff.terrell18:10:11

@eggsyntax - I don't know of an "magit undo stage" command, but I do know of some shortcuts that might make that a little less painful. (1) You can hit 1, 2, 3, and 4 to change the display level of whatever the cursor's at. So instead of tabbing around, you might be able to just say e.g. 1 to collapse it all the way. (2) You can select specific lines to stage or unstage with v.

eggsyntax18:10:54

#2 I use & is maybe my single favorite thing about magit 😄 #1 is brand new & def will save some time. Thanks!

ag18:10:14

Hey don't forget about M-1..4

eggsyntax18:10:07

Hmm...for me that does the same as just 1..4, without meta.

ag18:10:58

M-1 in magit-diff buffer should be bound to (magit-section-show-level-1-all)

ag18:10:21

meaning M-1..4 toggles ALL the sections

eggsyntax18:10:01

Ohhhh, gotcha. I happen to have only unstaged changes at the moment, so I didn't notice the difference.

jeff.terrell18:10:52

Ah, that's really good to know! Is that only the diff buffer, not the status buffer?

ag18:10:31

no it works everywhere

ag18:10:10

Yeah, it's a killer feature. In the beginning I didn't use magit-diff buffer much. I would find a hunk and press e and compare things in ediff. That's handy. But then I did two things: - I have changed the colors to make the diffs more readable - I started using 1..4 and M-1..4

jeff.terrell18:10:22

That's really good to know. I'm always wanting to do that in a magit diff buffer. I usually go to the last line and hit 1..4, which I think has the same effect, but no longer!

eggsyntax18:10:15

Nice. Want to pass along the color portion of your config?

eggsyntax18:10:16

Awesome, thanks! Yours I may go through in detail 🙂

eggsyntax18:10:03

The only color change I've thought of doing is making the hunk headers stand out more -- they're easy to overlook, which is how I get myself into the fix I mentioned earlier where I've staged more than I meant to..

ag18:10:25

Choice of the color-theme itself deserves a conversation. For a long time I've been searching for perfect one, something I would really like - I used Obsidian, then I switched to Zenburn (because it was the most popular Emacs theme). Then one day I realized - the less colors you have, the less strained your eyes would be. That's how Spacemacs' default themes do too. But the dark one has way to much pink to my taste.

eggsyntax18:10:20

Huh, interesting. "the less colors you have, the less strained your eyes would be." Is there evidence for that? It's not immediately obvious to me that it's true.

eggsyntax18:10:51

I don't like a zillion colors, but I like to be able to distinguish the various things that can be colored differently.

ag18:10:23

After all I have decided to stop trying and now I'm using Base-16 Ocean Dark (with my own customizations) and Spacemacs' default light theme. This is perfect combination for me. Whenever it's too bright in the room and there's too much glare I would do SPC T n and switch to the light theme and vice-versa

ag19:10:33

> Is there evidence for that? this is very subjective and YMMV, but the right choice of a font and the color theme is like choosing a knife for cooking. With a perfectly balanced knife you can cook with pleasure for hours.

eggsyntax19:10:54

Oh, 100% agreed on that.

eggsyntax19:10:20

I haven't noticed more colors being more tiring, but I'll start keeping an eye on it.

ag19:10:37

I can't recommend this thing enough https://chriskempson.github.io/base16/

eggsyntax19:10:04

I have a strong preference for muted colors, though; for me it seems to be bright, vivid colors that wear me out. Especially when they're not within some sensible color palette.

eggsyntax19:10:26

Yeah, for me base16 is actually probably too bright.

eggsyntax19:10:41

I did the two solarized ones for a looong time, now I'm on zenburn for dark.

ag19:10:47

please try it, find your perfect theme, sprinkle it with your customizations - ahhh... that's like getting married to a woman you love

eggsyntax19:10:54

Oh, for SURE 😄

eggsyntax19:10:27

I've spent many, many hours on that over the years. Solarized is tough to beat IMHO; I just finally got tired of it in the last year.

ag19:10:36

I do prefer "pastel" colors myself. Don't like too vibrant

eggsyntax19:10:53

Font, too, for me.

eggsyntax19:10:04

Drives me MAD to program all day in a bad font.

chris19:10:17

for me, the best part about solarized isn't that it's amazing or the best or anything, it's that it's available everywhere, for every platform and editor you could want

chris19:10:29

and you know it'll look fine

chris19:10:43

don't have to fuck with it, just set it any forget it

eggsyntax19:10:49

I do love that...although it's part of what led to me getting tired of it, I think; I was using it everywhere.

eggsyntax19:10:04

But it took > 5 years for that to happen.

jeff.terrell19:10:30

I haven't gotten tired of Solarized yet, but I'm enjoying the conversation and might have to fiddle with it someday. simple_smile

ag19:10:05

solarized is nice - I used it for quite awhile. But I think I'm too picky. Too much blue and green - makes me depressed, too much red and yellow - my eyes get tired.

ag19:10:20

When it comes to Font: I've tried Menlo, Ubuntu Mono, Input, Kermit, Source Code Pro. I really liked Input. Today I'm using Source Code Pro. From time to time I get bored and try a different font. I think I spend too much time trying to improve my productivity.

ag19:10:24

Way too much.

chris19:10:43

fira code for me

ag19:10:45

So it actually becomes really counterproductive

chris19:10:47

❤️ ligatures

eggsyntax19:10:16

Source Code Pro is my 2nd favorite, these days; Hack has become my #1.

chris19:10:17

I'm not that picky, I just need a dotted or slashed zero and ligatures

ag19:10:32

yeah, that's something I have to yet to try to get used to. I don't like ligatures. I don't know why. Maybe just need to try it for a week or so

eggsyntax19:10:38

But same, I've probably tried a couple dozen over the years...

eggsyntax19:10:24

I did switch to Fira Mono on mac, because oddly, I got a significant speed boost from it (a tip buried in one of the endless how-to-speed-up-spacemacs threads)

eggsyntax19:10:40

@chris is there a difference between Fira Mono and Fira Code?

chris19:10:49

fira code has ligatures, mostly

chris19:10:17

it also changed a few symbols to clear up a couple things

eggsyntax19:10:52

Oh, that's tonsky's, right?

chris19:10:54

like, the angle bracket characters look different than fira mono to make them a little more distinctive, it's mostly just little tweaks

eggsyntax19:10:27

I did like that one. I can't recall testing it for speed vs Fira Mono, but my guess is that I didn't get the speed boost or I would have used it.

eggsyntax19:10:01

I liked Inconsolata a lot, too; that's probably my 3rd fave.

chris19:10:04

well, you also have to add a bunch of hackish things to get emacs to render ligatures correctly

chris19:10:26

so, I can imagine that if you were just browsing around with fonts that probably wouldn't have appealed too much

eggsyntax19:10:13

No, I definitely remember using it & liking it. It just didn't quite end up as one of my top couple.

eggsyntax19:10:40

And didn't give me the speed boost, I think (which was the only reason I switched on mac).

ag23:10:41

Godddammit... I still can't understand why nobody has found a way to fix this thing. Why the heck we can't just go back to the definition? spacemacs-jump-handlers for clojure modes simply broken and I really hate that. This is the only thing where I can't win the argument against IntelliJ

ag23:10:58

because in Intellij in simply works.

ag23:10:31

The thing that pisses me off the most is my own laziness and inability to write an elisp function that would try to use cider-find-var and if for whatever reason it fails to find correct definition - it would fall back to dumb-jump-go.

ag23:10:26

because dumb-jump-go works fine in like 80% of cases