70

I am new to emacs(spacemacs), and I follow this article to learn spacemacs.

Once you are done editing, save the file and either press C-c C-c in the file to reload it or just restart Spacemacs.

But after I save the .spacemacs and then press C-c C-c, the powerline told me C-c C-c is undefined.

How can I reload .spacemacs file after editing without restart emacs?

user2331095
  • 6,577
  • 8
  • 36
  • 56

5 Answers5

127

I found the solution: SPC f e R

It is from "Dotfile Configuration" in the Spacemacs Docs.

stites
  • 4,903
  • 5
  • 32
  • 43
user2331095
  • 6,577
  • 8
  • 36
  • 56
  • 7
    Somehow this doesn't seem to work (I knew the keyboard shortcut already, but it is not working for me) e.g. I have "dotspacemacs-line-numbers t" in dotspacemacs/init But "SPC f e R" does not reflect the change. Quitting and starting spacemacs works. – Mandar Vaze Jan 05 '16 at 09:45
  • fyi I personally used (global-linum-mode) and (linum-relative-toggle) in my dotspacemacs/user-config to enable (relative) line numbers. (Just add them like that in the user-config block and reload) – mmlac May 20 '16 at 07:14
  • 5
    For those in emacs mode, you can use `M-m f e R` – TrakJohnson Aug 29 '17 at 08:43
  • That actually works well for me--maybe it works on recent version of spacemacs? – adonese Nov 15 '17 at 07:25
  • 3
    This does not seem to work if emacs is running in daemon mode. – Chris Stryczynski Jul 16 '18 at 10:51
  • is there a way to instruct it not to update melpa while reloading via M-m f e R ? – Anuvrat Parashar Sep 07 '19 at 19:15
30

SPC f e R doesn't work for me so I personally use SPC q R. It completely restarts spacemacs though - but if you maintain sessions (dotspacemacs-auto-resume-layouts t) in config), spacemacs will restart with same buffers. Hope it'll help someone.

dotspacemacs-auto-resume-layouts is a config option which can be found in setq-default section of your .spacemacs file. It comes with default spacemacs setup, it's default value is nil.

valignatev
  • 6,020
  • 8
  • 37
  • 61
7

For those who work in emacs mode, it might be little difficult to get this done with keybindings. In such case, do M-X then type dotspacemacs/sync-configuration-layers

Veera
  • 861
  • 1
  • 9
  • 18
1

SPC q r or (restart-emacs-resume-layouts) will restart emacs whilst preserving the layout.

Sherlock
  • 5,557
  • 6
  • 50
  • 78
0

Another way to do this is press space twice (SPC SPC) which brings you into the emacs command mode.

Then type: sync-config and press Enter which will execute the dotspacemacs/sync-configuration-layers command and reload your config.

mpaepper
  • 3,952
  • 3
  • 21
  • 28