- Common
- Which version of Spacemacs am I running?
- What is the official pronunciation of Spacemacs?
- How to fix package download errors when installing Spacemacs ?
- The Spacemacs banner is ugly, what should I do?
- The powerline separators are ugly, how can I fix them?
- The powerline separators have no anti-aliasing, what can I do?
- Why is after-init-hook not executed?
- user-init or
user-config?”>Should I place my settings inuser-initoruser-config? - Why is Spacemacs hanging on startup?
- Why does my color theme not render correctly in terminal mode?
- fd takes me out of
insert state. What is going on?”>Typing quicklyfdtakes me out ofinsert state. What is going on? - Why do I get files starting with .#?
- How do I…
- Install a package not provided by a layer?
- Disable a package completely?
- Disable a package only for a specific major-mode?
- Disable company for a specific major-mode?
- Change special buffer rules?
- Enable navigation by visual lines?
- Disable evilification of a mode?
- Include underscores in word motions?
- Change or define an alias for a leader key?
- Restore the sentence delimiter to two spaces?
- Prevent the visual selection overriding my system clipboard?
- Make spell-checking support curly quotes (or any other character)?
- Try Spacemacs without modifying my existing Emacs configuration?
- Make copy/paste working with the mouse in X11 terminals?
- Windows
- Why do the fonts look crappy on Windows?
- Why is there no Spacemacs logo in the startup buffer?
- Why are all packages unavailable?
- OS X
The version is displayed on the upper right corner of the loading screen. You may also just type
SPC f e v.As it is written, that is space then macs.
To declare new packages you have to create a new configuration layer or add the package name to the variable
dotspacemacs-additonal-packagesof your dotfile, see the quick start guide for more info.Since 0.105.0 HTTPS protocol is used by default to download packages. If your environment does not allow HTTPS to reach ELPA repositories then you can start Emacs with the
--insecureargument for force the usage of HTTP non secured protocol. You can set the variabledotspacemacs-elpa-httpstonilin your dotfile to remove the need to start Emacs with--insecure=argument.Install the default font supported by Spacemacs or choose a fixed width font. More information in the font section of the documentation.
Use the property
:powerline-scaleof the variabledotspacemacs-default-font. See font section of the documentation for more details.Emacs powerline uses XMP images to draw the separators in a graphical environment. You can have anti-aliasing if you use the
utf8separator. Note that by default theutf8separator is used in a terminal. See the powerline section in the font section of the documentation.Don’t launch Spacemacs with
emacs -q -l init.elcommand. This command will run the hooked functions inafter-init-hookbefore the evaluation of the passed-l init.elfile.The
distributionconcept was introduced in 0.104.x. You can now choose between two distributionsspacemacsorspacemacs-base.spacemacs-basecontains only a minimal set of packages; whereasspacemacsis the full Spacemacs experience.Set the distribution with
dotspacemacs-distributionvariable. The default isspacemacs. For more information as to what is included, check out thepackages.elfile in the respective folders in the+distributionfolder of thelayers/directory.Any variable that layer configuration code will read and act on must be set in
user-init, and any variable that Spacemacs explicitly sets but you wish to override must be set inuser-config.Anything that isn’t just setting a variable should 99% be in
user-config.Since version 0.104, spacemacs uses the
orgversion from the org ELPA repository instead of the one shipped with emacs. Then, anyorgrelated code should not be loaded beforedotspacemacs/user-config, otherwise both versions will be loaded and will conflict.Because of autoloading, calling to
orgfunctions will trigger the loading up of theorgshipped with emacs wich will induce conflicts. One way to avoid conflict is to wrap yourorgconfig code in awith-eval-after-loadblock like this:(with-eval-after-load 'org ;; here goes your Org config :) ;; .... )
This is probably related to Helm using Tramp which tries to figure out some SSH/DNS settings at startup. The root cause is probably your ISP redirecting non-existing addresses to their own servers.
Try using these settings in the
user-initfunction in your.spacemacsconfiguration:(setq tramp-ssh-controlmaster-options "-o ControlMaster=auto -o ControlPath='tramp.%%C' -o ControlPersist=no")
See issue #3422 and helm issue #1000 for details. If for any reason this code is not working, you can try to put these settings directly in
~/.ssh/config:Host * ControlMaster auto ControlPath ~/.ssh/master -%r@%h:%p ControlPersist = no
If you try to run
helm-M-xwith the prefix argument (i.e.SPC u SPC SPC) it will fail with this message:Instead, call
helm-M-xfirst, select the command you want to run, and pressC-ubefore pressingRETURN. For instance:SPC SPC org-reload C-u RETIn the terminal version of Emacs, color themes will not render correctly as colors are rendered by the terminal and not by emacs. You will probably have to change your terminal color palette. More explanations can be found on emacs-color-theme-solarized webpage.
This is most likely caused by a corrupted package archive. Try deleting your
~/.emacs.d/elpa/archives/folder and restart Emacs.This is a feature of Spacemacs, enabling you to easily escape from a lot of situations, like escaping from
insert statetonormal state.The sequence of characters used can be customized. See the documentation for more information.
If you don’t like this feature, you can deactivate it by adding
evil-escapetodotspacemacs-excluded-packagesin your init file.These are lockfiles, created by Emacs to prevent editing conflicts which occur when the same file is edited simultaneously by two different programs. To disable this behaviour:
(setq create-lockfiles nil)
Spacemacs provides a variable in the
dotspacemacs/layersfunction in.spacemacscalleddotspacemacs-additional-packages. Just add a package name to the list and it will be installed when you reload your configuration withSPC f e R, or at the next Spacemacs launch.To completely disable a package and effectively uninstalling it even if it is part of your used layers, look for the variable
dotspacemacs-excluded-packagesin your dotfile and add the package name to it:(setq-default dotspacemacs-excluded-packages '(package1 package2 ...))This is done by removing the hook added by Spacemacs. For example to remove
flychecksupport in python buffers, look for the functiondotspacemacs/user-configin your dotfile and add the following code:(remove-hook 'python-mode-hook 'flycheck-mode)
Hint to know the name of the major-mode of the current buffer press:
SPC h d v major-mode RETIt may be handy to disable
companyfor a given mode if you plan on configuringauto-completeinstead. One easy way to do it is to use the macrospacemacs|disable-companyin the functiondotspacemacs/user-configof your dotfile. The following snippet disables company forpython-mode:(spacemacs|disable-company python-mode)
To change the way spacemacs marks buffers as useless, you can customize
spacemacs-useless-buffers-regexpwhich marks buffers matching the regexp as useless. The variablespacemacs-useful-buffers-regexpmarks buffers matching the regexp as useful buffers. Both can be customized the same way.Examples:
;; Only mark helm buffers as useless (setq spacemacs-useless-buffers-regexp '("\\*helm\.\+\\*")) ;; Marking the *Messages* buffer as useful (push "\\*Messages\\*" spacemacs-useful-buffers-regexp)
Add the following snippet to your
dostpacemacs/configfunction:;; Make evil-mode up/down operate in screen lines instead of logical lines (define-key evil-motion-state-map "j" 'evil-next-visual-line) (define-key evil-motion-state-map "k" 'evil-previous-visual-line) ;; Also in visual mode (define-key evil-visual-state-map "j" 'evil-next-visual-line) (define-key evil-visual-state-map "k" 'evil-previous-visual-line)
You can ensure a mode opens in emacs state by using
evil-set-initial-state.(evil-set-initial-state 'magit-status-mode 'emacs)
You can also do this using buffer name regular expressions. E.g. for magit, which has a number of different major modes, you can catch them all with
(push '("*magit" . emacs) evil-buffer-regexps)
This should make all original magit bindings work in the major modes in question. To enable the leader key in this case, you may have to define a binding in the mode’s map, e.g. for
magit-status-mode,(with-eval-after-load 'magit (define-key magit-status-mode-map (kbd dotspacemacs-leader-key) spacemacs-default-map))
You can modify the syntax table of the mode in question. To do so you can include this on your
dotspacemacs/user-config.;; For python (add-hook 'python-mode-hook #'(lambda () (modify-syntax-entry ?_ "w"))) ;; For ruby (add-hook 'ruby-mode-hook #'(lambda () (modify-syntax-entry ?_ "w"))) ;; For Javascript (add-hook 'js2-mode-hook #'(lambda () (modify-syntax-entry ?_ "w")))
Some layers require certain tools to be available on your
$PATH. This means that your$PATHmust contain the installation paths for those tools. For example, if you have installed some tools to~/.local/binand want them to be available in Spacemacs, you need to add~/.local/binto your$PATH.Users of
bash,zsh,shand other similar shells should add following line to their.bashrc(.zshrc,.profileor your shell’s equivalent). Note that theexportpart is very important.export PATH=~/.local/bin:$PATH
Users of
fishshould add following line to theirconfig.fishfile (should be in$XDG_CONFIG_HOMEor its default value -~/.config/fish). Note that-xpart is very important.set -x PATH ~/.local/bin $PATH
Users of other shells should consult its documentation on how to setup
$PATHvariable (with export to environment).So now,
~/.local/binshould be available in your$PATH. You can verify this by callingecho $PATH. But you also should verify that$PATHis set properly in your environment. To do so call following command in your terminal.env | grep "PATH"
This is the value that will be used by Emacs. So it must contain
~/.local/bin.After that you can run Spacemacs and check that it properly gets the value of
$PATHby runningM-: (getenv "PATH").Note that having
~/.local.binin your$PATHalso means that it’s possible to run terminal and call tools from~/.local/binwithout specifying their full path. Under certain conditions you might want to avoid modifying your$PATH. In that case you have the option of updating the value ofexec-pathin thedotspacemacs/user-configfunction of your.spacemacsfile.(add-to-list 'exec-path "~/.local/bin/")
It is possible to change a leader key by binding its keymap to another sequence. For instance, if you want to switch
SPC S(spelling) withSPC d(used by dash) to make the former easier to reach, you can use:(defun dear-leader/swap-keys (key1 key2) (let ((map1 (lookup-key spacemacs-default-map key1)) (map2 (lookup-key spacemacs-default-map key2))) (spacemacs/set-leader-keys key1 map2 key2 map1))) (dear-leader/swap-keys "S" "d")
If you want to define your own alias, like using
SPC é(because it’s a not used key on your keyboard-layout for instance) for accessingSPC w(windows management), you can use this:(defun dear-leader/alias-of (key1 key2) (let ((map (lookup-key spacemacs-default-map key2))) (spacemacs/set-leader-keys key1 map))) (dear-leader/alias-of "é" "w")
To restore the sentence delimiter to two spaces, add the following code to the
dotspacemacs/user-initfunction of your.spacemacs:(setq sentence-end-double-space t)
On some operating systems, there is only one clipboard for both copied and selected texts. This has the consequence that visual selection – which should normally be saved to the PRIMARY clipboard – overrides the SYSTEM clipboard, where normally goes the copied text. This can be corrected by adding the following code to the
dotspacemacs/user-configof your.spacemacs:(fset 'evil-visual-update-x-selection 'ignore)
To have spell-checking support curly quotes (or any other character), you need to add a new entry to
ispell-local-dictionary-alist, by adding for example the following code in thedotspacemacs/user-configof your.spacemacs:(add-to-list 'ispell-local-dictionary-alist (quote ("my_english" "[[:alpha:]]" "[^[:alpha:]]" "['’]" t ("-d" "en_US") nil utf-8)))
You can then add any regular expression you want in the fourth argument (i.e. add a symbol within
['’]) to make it supported. Consult the help ofispell-dictionary-alistfor more details about the possibilities.You finally have to set
my_englishas yourispell-local-dictionaryin order to use the dictionary supporting your newly added characters.Spacemacs can be used as the
$EDITOR(or$GIT_EDITOR) for editing git commits messages. To enable this you have to add the following line to yourdotspacemacs/user-config:(global-git-commit-mode t)Emacs’ ability to use any directory as the home for launching it allows us to try out Spacemacs (or any other Emacs configuration we desire) without having to go through the trouble of backing up our
~/.emacs.ddirectory and then cloning the new configuration. This can be achieved easily using the following steps:mkdir ~/spacemacs git clone git@github.com:syl20bnr/spacemacs.git ~/spacemacs/.emacs.d HOME=~/spacemacs emacs
If you’re on Fish shell, you will need to modify the last command to:
env HOME=$HOME/spacemacs emacsIt is possible to disable the mouse support in X11 terminals in order to enable copying/pasting with the mouse. You need to add this line to your
dotspacemacs/user-config:(xterm-mouse-mode -1)
It is possible to restrict the scope of
helm-agto search only expressions in some specified file types. There is two way of doing this, both by appending some expressions to the search input:- By using a regexp with
-G, for instance-G\.el$will look for all files ending with.elwhich are emacs-lisp files. - By using a flag like
--pythonwhich should be self-explaining. The list of available flags colud be accessed from terminal with:ag --list-file-types
This is possible because
helm-agis treating the search input as command-line arguments of theagprogram.You can install MacType on Windows to get very nice looking fonts. It is also recommended to disable smooth scrolling on Windows.
A GUI build of emacs supporting image display is required. You can follow the instructions here. Alternatively you can download binaries of emacs with image support included such as this one.
Check if your Emacs has HTTPS capabilities by doing
M-:and then:(gnutls-available-p)If this returns
nil, you need to install the GnuTLS DLL file in the same directory as Emacs. See here for instructions.You can follow this explanation explaining how to correct this.
This is a known issue as of Emacs 24.4 due to
ns-use-srgb-colorspacedefaulting to true. It is recommended to use the emacs-mac-port build. See the install section in the README for more details.