Fork me on GitHub
#spacemacs
<
2021-03-11
>
Gleb Posobin14:03:06

I think SPC h k shows you what is bound to the given key.

grazfather15:03:40

SPC h d k does, but it’s still a bunch of chasing since you have to unmap that key, restart, then see what’s ‘next in line’, or mapped behind it

grazfather15:03:47

I want to basically unmap it entirely

Sam H17:03:31

@grazfather Have tried helm-descbinds ? This does seem to show the bindings in the current modes you're in

grazfather17:03:30

Oh, no, thank you, that’s very helpful @shan. Slightly on topic: HOw can I get helm to match literally? if I type c-n it matches thinks like SPc C-v n

Sam H17:03:33

wrapping in "" seems to work `"C-n"`

grazfather17:03:26

Oh, thank you. In fzf I think preceding with a ' works. I had tried that. You have to close the quotes here, too.

Kira Howe19:03:31

Hello! Sometimes with spacemacs my repl slows waaaayyyyy down.. like taking minutes to figure out (+ 1 1). I suspect my spacemacs config because I don’t seem to have the same issue with a fresh spacemacs setup. I’m wondering if anyone has tips for debugging. I don’t really know where to start looking for the problem other than brute force.. just deleting half my config at a time.. are there any tools available to try to narrow down what might be causing the extreme slowness?

practicalli-johnny19:03:33

There are some general tips and links towards the bottom of this page https://practicalli.github.io/spacemacs/install-spacemacs/troubleshooting.html

Kira Howe19:03:38

cool, thanks!

Kira Howe19:03:35

so far I’ve just been restarting everything when it happens and hoping it doesn’t happen again :face_palm: of course it always does. I really do want to get to the bottom of it but also I’d rather be writing code!

Kira Howe19:03:52

looks interesting, thank you. I’ll check that out.

grazfather19:03:01

Funny story: I went to test out SPC a p from practicalli’s link and I noticed that my Emacs was in a hard hang 😒

practicalli-johnny19:03:45

If the repl buffer is getting quite large, try setting a size limit in .spacemacs layer configuration

(clojure :variables
              cider-repl-buffer-size-limit 100)
100 is quite an extreme number, try 1000 if you want to see some history.

practicalli-johnny19:03:16

Avoid evaluating code directly in the REPL buffer and use source code buffers instead. Avoid writing logs to the REPL buffer.

practicalli-johnny19:03:08

Use cider-inspect to view any data more than 100 characters. Its an amazing tool and you can page through large data sets or deeply nested data without killing Emacs https://practicalli.github.io/spacemacs/evaluating-clojure/inspect.html

grazfather19:03:05

Why would putting a few thousand lines in the repl slow down emacs?

practicalli-johnny19:03:32

Other general steps you could try: • close any really big files • remove any layers you are not using • run Spacemacs develop branch • use SPC f e D to check nothing is missing from your .spacemacs configuration • run Emacs 26.3 or 27.x (if on a Mac, try a few different builds of Emacs) • try delete .emacs.d/elpa packages content and restart spacemacs to download and compile packages • avoid using lots of layouts / workspaces (although this only seems to affect startup time)

practicalli-johnny19:03:46

@grazfather you can slow down Emacs with a single line if its long enough and Emacs is trying to font lock it... and the default bi-directional processing is enabled in Emacs. font locking is very expensive in relative processing terms in emacs

practicalli-johnny19:03:08

That reminds me of some other general optomisations that can be made to emacs, assuming you use left-to-right languages

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  ;; Emacs text rendering optimizations
  ;; 

  ;; Only render text left to right
  (setq-default bidi-paragraph-direction 'left-to-right)

  ;; Disable Bidirectional Parentheses Algorithm
  (if (version<= "27.1" emacs-version)
      (setq bidi-inhibit-bpa t))

  ;; Files with known long lines
  ;; SPC f l to open files literally to disable most text processing

  ;; So long mode when Emacs thinks a file would affect performance
  (if (version<= "27.1" emacs-version)
      (global-so-long-mode 1))

  ;; End of: Emacs text rendering optimizations
  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
I assume this can be changed for right to left by changing the value

Sam H23:03:19

I’ve had spacemacs slowing down when I’ve had large output displayed in the repl. In which case cider-repl-clear-buffer helped.

Yehonathan Sharvit04:03:17

How could we avoid writing logs to the REPL buffer?

practicalli-johnny09:03:56

Explicitly write them elsewhere... Mulog is an excellent logging project https://github.com/BrunoBonacci/mulog

Yehonathan Sharvit09:03:11

That seems too much of an integration effort.

Yehonathan Sharvit09:03:41

Isn’t a simple way inside CIDER to avoid printing the log to the REPL buffer?

Yehonathan Sharvit09:03:06

or at least tell emacs not to do any font locks to the REPL buffer

practicalli-johnny09:03:40

Up to you. I wouldn't generate logs if I wasn't going to use them properly

Yehonathan Sharvit10:03:10

I need the logs on my screen