2015-10-30 13:23:24 +00:00
#+TITLE : Frequently Asked Questions
2015-10-30 11:20:58 +00:00
2019-05-07 20:05:06 +00:00
* Table of Contents :TOC_5_gh:noexport:
2017-05-22 14:16:12 +00:00
- [[#common ][Common ]]
- [[#which-version-of-spacemacs-am-i-running ][Which version of Spacemacs am I running? ]]
- [[#what-is-the-official-pronunciation-of-spacemacs ][What is the official pronunciation of Spacemacs? ]]
- [[#why-do-you-call-this-a-distribution-i-dont-see-any-spacemacs-executable ][Why do you call this a "distribution", I don't see any "Spacemacs" executable? ]]
- [[#why-are-packages-installed-with-package-install-automatically-deleted-by-spacemacs-when-it-boots ][Why are packages installed with =package-install= automatically deleted by Spacemacs when it boots? ]]
2018-06-25 06:16:27 +00:00
- [[#environment-variables-or-path-are-not-set-properly ][Environment variables or PATH are not set properly ]]
2017-05-22 14:16:12 +00:00
- [[#how-to-fix-package-download-errors-when-installing-spacemacs- ][How to fix package download errors when installing Spacemacs ? ]]
- [[#how-to-fix-symbols-value-as-variable-is-void-errors-on-startup ][How to fix =Symbol's value as variable is void= errors on startup? ]]
- [[#how-to-fix-wrong-type-argument-arrayp-nil-errors-on-startup ][How to fix =(wrong-type-argument arrayp nil)= errors on startup? ]]
- [[#the-spacemacs-banner-is-ugly-what-should-i-do ][The Spacemacs banner is ugly, what should I do? ]]
- [[#the-powerline-separators-are-ugly-how-can-i-fix-them ][The powerline separators are ugly, how can I fix them? ]]
- [[#the-powerline-separators-have-no-anti-aliasing-what-can-i-do ][The powerline separators have no anti-aliasing, what can I do? ]]
- [[#why-is-after-init-hook-not-executed ][Why is after-init-hook not executed? ]]
- [[#what-is-the-difference-between-spacemacs-base-and-spacemacs-distributions ][What is the difference between =spacemacs-base= and =spacemacs= distributions? ]]
- [[#should-i-place-my-settings-in-user-init-or-user-config ][Should I place my settings in =user-init= or =user-config=? ]]
- [[#why-do-some-of-my-org-related-settings-cause-problems ][Why do some of my =org=-related settings cause problems? ]]
- [[#why-is-spacemacs-hanging-on-startup ][Why is Spacemacs hanging on startup? ]]
- [[#why-does-helm-m-x-spc-spc-not-accept-the-prefix-argument ][Why does =helm-M-x= (~SPC SPC~) not accept the prefix argument? ]]
- [[#why-does-my-color-theme-not-render-correctly-in-terminal-mode ][Why does my color theme not render correctly in terminal mode? ]]
- [[#typing-quickly-fd-takes-me-out-of-insert-state-what-is-going-on ][Typing quickly =fd= takes me out of =insert state=. What is going on? ]]
- [[#why-do-i-get-files-starting-with- ][Why do I get files starting with .#? ]]
- [[#why-do-i-get-4m-characters-inside-ansi-term ][Why do I get '4m' characters inside ansi-term? ]]
- [[#why-are-my-font-settings-not-being-respected ][Why are my font settings not being respected? ]]
- [[#why-am-i-getting-a-message-about-environment-variables-on-startup ][Why am I getting a message about environment variables on startup? ]]
- [[#i-want-to-learn-elisp-where-do-i-start- ][I want to learn elisp, where do I start ? ]]
2020-01-08 07:47:35 +00:00
- [[#how-do-i ][How do I ]]
2017-05-22 14:16:12 +00:00
- [[#install-a-package-not-provided-by-a-layer ][Install a package not provided by a layer? ]]
- [[#disable-a-package-completely ][Disable a package completely? ]]
- [[#disable-a-package-only-for-a-specific-major-mode ][Disable a package only for a specific major-mode? ]]
- [[#disable-company-for-a-specific-major-mode ][Disable company for a specific major-mode? ]]
- [[#change-special-buffer-rules ][Change special buffer rules? ]]
- [[#enable-navigation-by-visual-lines ][Enable navigation by visual lines? ]]
- [[#disable-evilification-of-a-mode ][Disable evilification of a mode? ]]
- [[#include-underscores-in-word-motions ][Include underscores in word motions? ]]
- [[#setup-path ][Setup =$PATH=? ]]
- [[#change-or-define-an-alias-for-a-leader-key ][Change or define an alias for a leader key? ]]
- [[#restore-the-sentence-delimiter-to-two-spaces ][Restore the sentence delimiter to two spaces? ]]
- [[#prevent-the-visual-selection-overriding-my-system-clipboard ][Prevent the visual selection overriding my system clipboard? ]]
- [[#make-spell-checking-support-curly-quotes-or-any-other-character ][Make spell-checking support curly quotes (or any other character)? ]]
- [[#use-spacemacs-as-the-editor-for-git-commits ][Use Spacemacs as the =$EDITOR= for git commits? ]]
- [[#try-spacemacs-without-modifying-my-existing-emacs-configuration ][Try Spacemacs without modifying my existing Emacs configuration? ]]
- [[#make-copypaste-working-with-the-mouse-in-x11-terminals ][Make copy/paste working with the mouse in X11 terminals? ]]
- [[#use-helm-ag-to-search-only-in-files-of-a-certain-type ][Use =helm-ag= to search only in files of a certain type? ]]
- [[#modify-spacemacs-documentation-look-space-doc-mode ][Modify spacemacs documentation look (space-doc-mode) ]]
- [[#remap-paste-key-to-be-able-to-paste-copied-text-multiple-times ][Remap paste key to be able to paste copied text multiple times ]]
- [[#windows ][Windows ]]
- [[#why-do-the-fonts-look-crappy-on-windows ][Why do the fonts look crappy on Windows? ]]
- [[#why-is-there-no-spacemacs-logo-in-the-startup-buffer ][Why is there no Spacemacs logo in the startup buffer? ]]
- [[#why-are-all-packages-unavailable ][Why are all packages unavailable? ]]
- [[#the-powerline-isnt-shown-correctly-when-spacemacs-is-used-within-putty ][The powerline isn't shown correctly when Spacemacs is used within =PuTTY= ]]
2015-10-30 11:20:58 +00:00
* Common
** Which version of Spacemacs am I running?
2015-10-06 20:17:48 +00:00
The version is displayed on the upper right corner of the loading screen. You
may also just type ~SPC f e v~ .
2015-09-23 03:26:12 +00:00
2015-10-30 11:20:58 +00:00
** What is the official pronunciation of Spacemacs?
2019-11-09 19:05:57 +00:00
It's _space_ then _macs_ .
2015-09-23 03:26:12 +00:00
2016-10-09 14:43:57 +00:00
** Why do you call this a "distribution", I don't see any "Spacemacs" executable?
2019-05-26 20:58:52 +00:00
Although we could do it we don't package Emacs with Spacemacs. We allow users to
2016-10-09 14:43:57 +00:00
choose whatever build of Emacs they want that works with their OS, this is more
2017-09-07 22:06:27 +00:00
flexible and it saves us tons of issues. Spacemacs is more than a configuration
2016-10-09 14:43:57 +00:00
of Emacs it comes with advanced feature, concepts and tooling. Roughly, think of
it as a Linux distribution where we would ask people to install the kernel first
and then fetch somehow the actual code to get the distribution.
Note that some Linux distributions may start to create packages for Spacemacs,
they are unofficial packages, we will never package Emacs with Spacemacs.
2015-10-30 11:20:58 +00:00
** Why are packages installed with =package-install= automatically deleted by Spacemacs when it boots?
2016-05-31 02:58:59 +00:00
By default Spacemacs will keep only the packages that you use (i.e. the packages
belonging to a layer explicitly listed in the variable
=dotspacemacs-configuration-layers= ).
To install packages that does not belong to any Spacemacs layers, you can:
2016-09-22 23:45:12 +00:00
- use the variable =dotspacemacs-additional-packages= .
2016-05-31 02:58:59 +00:00
- or create a configuration layer configuring the package and add this layer to
=dotspacemacs-configuration-layers=
2016-08-20 00:31:57 +00:00
- or set the variable =dotspacemacs-install-packages= to =used-but-keep-unused=
2016-05-31 02:58:59 +00:00
which will prevent Spacemacs from removing the packages you installed
manually.
2017-07-16 16:37:37 +00:00
To create a new configuration layer see the [[https://github.com/syl20bnr/spacemacs/blob/master/doc/QUICK_START.org ][quick start guide ]] for more info.
2015-09-23 03:26:12 +00:00
2018-06-25 06:16:27 +00:00
** Environment variables or PATH are not set properly
2019-05-26 20:58:52 +00:00
If you use Emacs GUI and don't launch if from a terminal then edit the
2018-06-25 06:16:27 +00:00
environment variables in the =env= file. You can open this file with
~SPC f e e~ . More information in the =Environment variables= section of the
[[https://github.com/syl20bnr/spacemacs/blob/master/doc/DOCUMENTATION.org ][documentation ]].
2016-01-05 06:16:29 +00:00
** How to fix package download errors when installing Spacemacs ?
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 =--insecure= argument for force the usage of HTTP non secured
2016-01-31 19:35:53 +00:00
protocol. You can set the variable =dotspacemacs-elpa-https= to =nil= in your
2016-06-17 06:28:09 +00:00
dotfile to remove the need to start Emacs with =--insecure= argument.
2016-01-05 06:16:29 +00:00
2016-04-01 13:19:20 +00:00
** How to fix =Symbol's value as variable is void= errors on startup?
If Emacs reports an error that the symbol =closed= or =-= is unbound as a
variable, it is probably because you are using HTTPS to download packages, but
2019-05-26 20:58:52 +00:00
you shouldn't be. Try deleting your packages (the =.emacs.d/elpa= folder), and
2016-04-01 13:19:20 +00:00
restart Emacs without HTTPS to download the packages again. There are two ways
to do this:
- Run Emacs with the =--insecure= command line argument: =emacs --insecure= . You
will have to do this again the next time you update your packages.
- Set the variable =dotspacemacs-elpa-https= to =nil= in your dotfile. This has
the same effect as =--insecure= , but is persistent.
** How to fix =(wrong-type-argument arrayp nil)= errors on startup?
This is most likely caused by a corrupted package archive. Try deleting your
=~/.emacs.d/elpa/archives/= folder and restart Emacs.
2015-10-30 11:20:58 +00:00
** The Spacemacs banner is ugly, what should I do?
2015-09-23 03:26:12 +00:00
Install the default font supported by Spacemacs or choose a fixed width font.
2017-07-16 16:37:37 +00:00
More information in the font section of the [[https://github.com/syl20bnr/spacemacs/blob/develop/doc/DOCUMENTATION.org ][documentation ]].
2015-09-23 03:26:12 +00:00
2015-10-30 11:20:58 +00:00
** The powerline separators are ugly, how can I fix them?
2018-01-17 03:59:29 +00:00
Use the property =:separator-scale= of the variable
=dotspacemacs-mode-line-theme= . See mode-line section of the [[https://github.com/syl20bnr/spacemacs/blob/develop/doc/DOCUMENTATION.org ][documentation ]] for
more details.
2015-09-23 03:26:12 +00:00
2015-10-30 11:20:58 +00:00
** The powerline separators have no anti-aliasing, what can I do?
2015-09-23 03:26:12 +00:00
Emacs powerline uses XMP images to draw the separators in a graphical
2015-10-06 20:17:48 +00:00
environment. You can have anti-aliasing if you use the =utf8= separator. Note
that by default the =utf8= separator is used in a terminal. See the powerline
2017-07-16 16:37:37 +00:00
section in the font section of the [[https://github.com/syl20bnr/spacemacs/blob/develop/doc/DOCUMENTATION.org ][documentation ]].
2015-09-23 03:26:12 +00:00
2015-10-30 11:20:58 +00:00
** Why is after-init-hook not executed?
2019-05-26 20:58:52 +00:00
Don't launch Spacemacs with =emacs -q -l init.el= command. This command will run
2016-01-31 19:35:53 +00:00
the hooked functions in =after-init-hook= before the evaluation of the passed
=-l init.el= file.
2015-09-23 03:26:12 +00:00
2015-10-30 11:20:58 +00:00
** What is the difference between =spacemacs-base= and =spacemacs= distributions?
2016-01-31 19:35:53 +00:00
The =distribution= concept was introduced in 0.104.x. You can now choose between
two distributions =spacemacs= or =spacemacs-base= . =spacemacs-base= contains
only a minimal set of packages; whereas =spacemacs= is the full Spacemacs
experience.
2015-10-06 20:17:48 +00:00
Set the distribution with =dotspacemacs-distribution= variable. The default is
2016-01-31 19:35:53 +00:00
=spacemacs= . For more information as to what is included, check out the
2016-06-09 02:16:40 +00:00
=packages.el= file in the respective folders in the =+distributions= folder of
2016-01-31 19:35:53 +00:00
the =layers/= directory.
2015-10-06 20:17:48 +00:00
2015-10-30 11:20:58 +00:00
** Should I place my settings in =user-init= or =user-config=?
2015-10-06 20:17:48 +00:00
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 in =user-config= .
2019-05-26 20:58:52 +00:00
Anything that isn't just setting a variable should 99% be in =user-config= .
2015-11-09 18:00:17 +00:00
2019-01-01 09:42:00 +00:00
Note that at time of writing files supplied as command line arguments to emacs
2019-04-27 00:15:28 +00:00
will be read before =user-config= is executed. (Hence to yield consistent
2019-01-01 09:42:00 +00:00
behaviour, mode hooks should be set in =user-init= .)
2015-10-30 11:20:58 +00:00
** Why do some of my =org=-related settings cause problems?
2015-12-04 05:04:46 +00:00
Since version 0.104, spacemacs uses the =org= version from the org ELPA
repository instead of the one shipped with emacs. Then, any =org= related code
should not be loaded before =dotspacemacs/user-config= , otherwise both versions
2015-10-12 20:48:47 +00:00
will be loaded and will conflict.
2015-12-04 05:04:46 +00:00
Because of autoloading, calling to =org= functions will trigger the loading up
2017-05-01 19:56:04 +00:00
of the =org= shipped with emacs which will induce conflicts. One way to avoid
2016-01-31 19:35:53 +00:00
conflict is to wrap your =org= config code in a =with-eval-after-load= block
like this:
2015-12-02 06:18:58 +00:00
#+BEGIN_SRC emacs-lisp
2017-04-18 06:05:28 +00:00
(with-eval-after-load 'org
;; Org config goes here
;; ....
)
2015-12-02 06:18:58 +00:00
#+END_SRC
2015-11-07 16:13:08 +00:00
** Why is Spacemacs hanging on startup?
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-init~ function in your ~.spacemacs~
configuration:
2015-11-28 17:05:05 +00:00
#+BEGIN_SRC emacs-lisp
2018-09-19 03:54:47 +00:00
(setq tramp-ssh-controlmaster-options
"-o ControlMaster=auto -o ControlPath= 'tramp.%%C' -o ControlPersist=no")
2015-11-07 16:13:08 +00:00
#+END_SRC
2015-11-28 16:24:32 +00:00
See [[https://github.com/syl20bnr/spacemacs/issues/3422#issuecomment-148919047 ][issue #3422 ]] and [[https://github.com/emacs-helm/helm/issues/1000#issuecomment-119487649 ][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= :
2016-01-31 19:53:55 +00:00
#+BEGIN_SRC ssh
2018-09-19 03:54:47 +00:00
Host *
ControlMaster auto
ControlPath ~/.ssh/master -%r@%h:%p
ControlPersist = no
2016-01-31 19:53:55 +00:00
#+END_SRC
2015-11-07 16:13:08 +00:00
2016-02-03 01:27:08 +00:00
** Why does =helm-M-x= (~SPC SPC~) not accept the prefix argument?
If you try to run =helm-M-x= with the prefix argument (i.e. ~SPC u SPC SPC~ ) it
2015-11-16 20:06:43 +00:00
will fail with this message:
2016-01-31 19:53:55 +00:00
#+BEGIN_VERSE
2018-09-19 03:54:47 +00:00
Error: Specifying a prefix arg before calling helm-M-x
2016-01-31 19:53:55 +00:00
#+END_VERSE
2015-11-16 20:06:43 +00:00
Instead, call =helm-M-x= first, select the command you want to run, and press
2016-02-03 01:27:08 +00:00
~C-u~ before pressing ~RETURN~ . For instance: ~SPC SPC org-reload C-u RET~
2015-11-16 20:06:43 +00:00
** Why does my color theme not render correctly in terminal mode?
In 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
2017-04-25 15:42:58 +00:00
[[https://github.com/sellout/emacs-color-theme-solarized#user-content-important-note-for-terminal-users ][emacs-color-theme-solarized webpage ]].
2015-11-16 20:06:43 +00:00
2016-01-13 21:23:27 +00:00
** Typing quickly =fd= takes me out of =insert state=. What is going on?
This is a feature of Spacemacs, enabling you to easily escape from a lot of
situations, like escaping from =insert state= to =normal state= .
2016-12-27 19:20:00 +00:00
The sequence of characters used can be customized. See the [[http://spacemacs.org/doc/DOCUMENTATION.html#escaping ][documentation ]] for
2016-01-13 21:23:27 +00:00
more information.
2019-05-26 20:58:52 +00:00
If you don't like this feature, you can deactivate it by adding =evil-escape= to
2016-01-13 21:23:27 +00:00
=dotspacemacs-excluded-packages= in your init file.
2016-02-23 09:36:25 +00:00
** Why do I get files starting with .#?
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:
#+BEGIN_SRC emacs-lisp
2018-09-19 03:54:47 +00:00
(setq create-lockfiles nil)
2016-02-23 09:36:25 +00:00
#+END_SRC
2016-03-29 09:55:11 +00:00
** Why do I get '4m' characters inside ansi-term?
2016-04-05 10:27:39 +00:00
Ansi-term only has a subset of capabilities supported by xterm256. Your shell
(e.g. fish shell) might ignore =$TERMINFO= information and require you to set
the =~/.terminfo= yourself.
2016-03-29 09:55:11 +00:00
#+BEGIN_SRC fish
2018-09-19 03:54:47 +00:00
tic -o ~/.terminfo $TERMINFO/e/eterm-color.ti
2016-03-29 09:55:11 +00:00
#+END_SRC
2016-06-23 00:16:46 +00:00
Note that =eterm-color.ti= may be at a different location, to find out the exact
location you may try to use =locate= :
#+BEGIN_SRC fish
2018-09-19 03:54:47 +00:00
locate eterm-color.ti
2016-06-23 00:16:46 +00:00
#+END_SRC
2016-05-05 13:13:30 +00:00
** Why are my font settings not being respected?
The settings of =dotspacemacs-default-font= (such as size, weight, etc.) will
only be applied if the name of the font exists on your system. Check to make
2019-05-26 20:58:52 +00:00
sure that this is the case. If Spacemacs can't find the font, there should be a
2016-05-05 13:13:30 +00:00
warning to this effect in the =*Messages*= buffer.
2016-08-21 15:24:13 +00:00
** Why am I getting a message about environment variables on startup?
Spacemacs uses the =exec-path-from-shell= package to set the executable path
when Emacs starts up. This is done by launching a shell and reading the values
of variables such as =PATH= and =MANPATH= from it. If your shell configuration
sets the values of these variables inconsistently, this could be problematic. It
is recommended to set such variables in shell configuration files that are
sourced unconditionally, such as =.profile= , =.bash_profile= or =.zshenv= , as
opposed to files that are sourced only for interactive shells, such as =.bashrc=
or =.zshrc= . If you are willing to neglect this advice, you may disable the
warning, e.g. from =dotspacemacs/user-init= :
#+BEGIN_SRC emacs-lisp
(setq exec-path-from-shell-check-startup-files nil)
#+END_SRC
You can also disable this feature entirely by adding =exec-path-from-shell= to
the list =dotspacemacs-excluded-packages= if you prefer setting =exec-path=
yourself.
2016-10-25 12:23:35 +00:00
** I want to learn elisp, where do I start ?
Very quick start: [[http://learnxinyminutes.com/docs/elisp/ ][learn X in Y minutes (where X is elisp) ]]
Practical reference with code examples for various situations that you will
encounter: [[http://caiorss.github.io/Emacs-Elisp-Programming/ ][http://caiorss.github.io/Emacs-Elisp-Programming/ ]], more particularly
sections [[http://caiorss.github.io/Emacs-Elisp-Programming/Elisp_Programming.html ][Elisp Programming ]] and [[http://caiorss.github.io/Emacs-Elisp-Programming/Elisp_Snippets.html ][Elisp code snippets ]].
2020-01-08 07:47:35 +00:00
* How do I
2015-11-16 18:40:07 +00:00
** Install a package not provided by a layer?
Spacemacs provides a variable in the =dotspacemacs/layers= function in
=.spacemacs= called =dotspacemacs-additional-packages= . Just add a package name
2015-11-16 20:06:43 +00:00
to the list and it will be installed when you reload your configuration with
~SPC f e R~ , or at the next Spacemacs launch.
2015-11-16 18:40:07 +00:00
2015-10-30 11:20:58 +00:00
** Disable a package completely?
2016-01-31 19:35:53 +00:00
To completely disable a package and effectively uninstalling it even if it is
part of your used layers, look for the variable =dotspacemacs-excluded-packages=
in your dotfile and add the package name to it:
2015-10-18 19:21:46 +00:00
2016-01-31 19:53:55 +00:00
#+BEGIN_SRC emacs-lisp
2018-09-19 03:54:47 +00:00
(setq-default dotspacemacs-excluded-packages '(package1 package2 ...))
2016-01-31 19:53:55 +00:00
#+END_SRC
2015-10-18 19:21:46 +00:00
2015-10-30 11:20:58 +00:00
** Disable a package only for a specific major-mode?
2016-01-31 19:35:53 +00:00
This is done by removing the hook added by Spacemacs. For example to remove
=flycheck= support in python buffers, look for the function
2015-10-18 19:21:46 +00:00
=dotspacemacs/user-config= in your dotfile and add the following code:
2016-01-31 19:53:55 +00:00
#+BEGIN_SRC emacs-lisp
2018-09-19 03:54:47 +00:00
(remove-hook 'python-mode-hook 'flycheck-mode)
2016-01-31 19:53:55 +00:00
#+END_SRC
2015-10-18 19:21:46 +00:00
2016-01-31 19:35:53 +00:00
*Hint* to know the name of the major-mode of the current buffer press: ~SPC h d
v major-mode RET~
2015-10-18 19:21:46 +00:00
2015-10-30 11:20:58 +00:00
** Disable company for a specific major-mode?
2016-01-31 19:35:53 +00:00
It may be handy to disable =company= for a given mode if you plan on configuring
=auto-complete= instead. One easy way to do it is to use the macro
=spacemacs|disable-company= in the function =dotspacemacs/user-config= of your
dotfile. The following snippet disables company for =python-mode= :
2015-10-18 19:21:46 +00:00
2016-01-31 19:53:55 +00:00
#+BEGIN_SRC emacs-lisp
2018-09-19 03:54:47 +00:00
(spacemacs|disable-company python-mode)
2016-01-31 19:53:55 +00:00
#+END_SRC
2015-10-18 19:21:46 +00:00
2015-10-30 11:20:58 +00:00
** Change special buffer rules?
2015-10-18 19:21:46 +00:00
To change the way spacemacs marks buffers as useless, you can customize
2016-01-31 19:35:53 +00:00
=spacemacs-useless-buffers-regexp= which marks buffers matching the regexp as
useless. The variable =spacemacs-useful-buffers-regexp= marks buffers matching
the regexp as useful buffers. Both can be customized the same way.
2015-10-18 19:21:46 +00:00
Examples:
2018-07-10 10:57:25 +00:00
2016-01-31 19:53:55 +00:00
#+BEGIN_SRC emacs-lisp
2018-09-19 03:54:47 +00:00
;; Only mark helm buffers as useless
(setq spacemacs-useless-buffers-regexp '("\\*helm\.\+\\* "))
2015-10-18 19:21:46 +00:00
2018-09-19 03:54:47 +00:00
;; Marking the *Messages* buffer as useful
(push "\\*Messages\\* " spacemacs-useful-buffers-regexp)
2016-01-31 19:53:55 +00:00
#+END_SRC
2015-10-18 19:21:46 +00:00
2015-10-30 11:20:58 +00:00
** Enable navigation by visual lines?
2016-05-05 02:30:17 +00:00
Add the following snippet to your =dotspacemacs/user-config= function:
2015-10-18 19:21:46 +00:00
2016-01-31 19:53:55 +00:00
#+BEGIN_SRC emacs-lisp
2019-10-30 09:00:05 +00:00
(spacemacs/toggle-visual-line-navigation-globally-on)
2016-01-31 19:53:55 +00:00
#+END_SRC
2015-10-18 19:21:46 +00:00
2015-10-30 11:20:58 +00:00
** Disable evilification of a mode?
2015-10-18 19:21:46 +00:00
You can ensure a mode opens in emacs state by using =evil-set-initial-state= .
2016-01-31 19:53:55 +00:00
#+BEGIN_SRC emacs-lisp
2018-09-19 03:54:47 +00:00
(evil-set-initial-state 'magit-status-mode 'emacs)
2016-01-31 19:53:55 +00:00
#+END_SRC
2015-10-18 19:21:46 +00:00
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
2016-01-31 19:53:55 +00:00
#+BEGIN_SRC emacs-lisp
2019-07-07 03:37:32 +00:00
(push '("magit*" . emacs) evil-buffer-regexps)
2016-01-31 19:53:55 +00:00
#+END_SRC
2015-10-18 19:21:46 +00:00
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
2019-05-26 20:58:52 +00:00
binding in the mode's map, e.g. for =magit-status-mode= ,
2015-10-18 19:21:46 +00:00
2016-01-31 19:53:55 +00:00
#+BEGIN_SRC emacs-lisp
2018-09-19 03:54:47 +00:00
(with-eval-after-load 'magit
(define-key magit-status-mode-map
(kbd dotspacemacs-leader-key) spacemacs-default-map))
2016-01-31 19:53:55 +00:00
#+END_SRC
2015-10-18 19:21:46 +00:00
2015-10-30 11:20:58 +00:00
** Include underscores in word motions?
2016-02-03 11:54:48 +00:00
You can modify the syntax table of the mode in question. To do so you can
include this on your =dotspacemacs/user-config= .
2015-10-23 10:30:23 +00:00
2016-01-31 19:53:55 +00:00
#+BEGIN_SRC emacs-lisp
2018-09-19 03:54:47 +00:00
;; 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")))
;; For all programming modes
(add-hook 'prog-mode-hook #'(lambda () (modify-syntax-entry ?_ "w")))
2020-09-06 20:33:50 +00:00
;; For all modes
(add-hook 'after-change-major-mode-hook #'(lambda () (modify-syntax-entry ?_ "w")))
2016-01-31 19:53:55 +00:00
#+END_SRC
2015-10-23 10:30:23 +00:00
2015-10-30 11:20:58 +00:00
** Setup =$PATH=?
2015-10-27 10:59:05 +00:00
Some layers require certain tools to be available on your =$PATH= . This means
2015-10-29 12:41:05 +00:00
that your =$PATH= must contain the installation paths for those tools. For
example, if you have installed some tools to =~/.local/bin= and want them to be
available in Spacemacs, you need to add =~/.local/bin= to your =$PATH= .
2015-10-27 10:59:05 +00:00
Users of =bash= , =zsh= , =sh= and other similar shells should add following line
2019-05-26 20:58:52 +00:00
to their =.bashrc= (=.zshrc= , =.profile= or your shell's equivalent). Note that
2015-10-27 10:59:05 +00:00
the =export= part is very important.
#+BEGIN_SRC sh
2018-09-19 03:54:47 +00:00
export PATH=~/.local/bin:$PATH
2015-10-27 10:59:05 +00:00
#+END_SRC
Users of =fish= should add following line to their =config.fish= file (should be
2015-10-29 12:41:05 +00:00
in =$XDG_CONFIG_HOME= or its default value - =~/.config/fish= ). Note that =-x=
2015-10-27 10:59:05 +00:00
part is very important.
2015-10-30 11:20:58 +00:00
#+BEGIN_SRC fish
2018-09-19 03:54:47 +00:00
set -x PATH ~/.local/bin $PATH
2015-10-27 10:59:05 +00:00
#+END_SRC
2015-10-29 12:41:05 +00:00
Users of other shells should consult its documentation on how to setup =$PATH=
2015-10-27 10:59:05 +00:00
variable (with export to environment).
2015-10-29 12:41:05 +00:00
So now, =~/.local/bin= should be available in your =$PATH= . You can verify this
by calling =echo $PATH= . But you also should verify that =$PATH= is set properly
in your environment. To do so call following command in your terminal.
2015-10-27 10:59:05 +00:00
#+BEGIN_SRC sh
2018-09-19 03:54:47 +00:00
env | grep "PATH"
2015-10-27 10:59:05 +00:00
#+END_SRC
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
=$PATH= by running =M-: (getenv "PATH")= .
2019-05-26 20:58:52 +00:00
Note that having =~/.local/bin= in your =$PATH= also means that it's possible to
2015-10-27 10:59:05 +00:00
run terminal and call tools from =~/.local/bin= without specifying their full
path. Under certain conditions you might want to avoid modifying your =$PATH= .
2015-10-29 12:41:05 +00:00
In that case you have the option of updating the value of =exec-path= in the
2015-10-27 10:59:05 +00:00
=dotspacemacs/user-config= function of your =.spacemacs= file.
2015-10-29 12:41:05 +00:00
#+BEGIN_SRC emacs-lisp
2018-09-19 03:54:47 +00:00
(add-to-list 'exec-path "~/.local/bin/ ")
2015-10-27 10:59:05 +00:00
#+END_SRC
2016-01-04 22:07:52 +00:00
** Change or define an alias for a leader key?
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) with ~SPC d~ (used by
dash) to make the former easier to reach, you can use:
2015-11-05 12:53:59 +00:00
2016-01-31 19:53:55 +00:00
#+BEGIN_SRC emacs-lisp
2017-04-18 06:05:28 +00:00
(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")
2016-01-31 19:53:55 +00:00
#+END_SRC
2015-11-05 12:53:59 +00:00
2019-05-26 20:58:52 +00:00
If you want to define your own alias, like using ~SPC é~ (because it's a not
2016-01-04 22:07:52 +00:00
used key on your keyboard-layout for instance) for accessing ~SPC w~ (windows
management), you can use this:
2015-11-05 12:53:59 +00:00
2016-01-31 19:53:55 +00:00
#+BEGIN_SRC emacs-lisp
2018-09-19 03:54:47 +00:00
(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")
2016-01-31 19:53:55 +00:00
#+END_SRC
2015-11-05 12:53:59 +00:00
2015-11-16 13:49:50 +00:00
** Restore the sentence delimiter to two spaces?
To restore the sentence delimiter to two spaces, add the following code to the
2019-04-10 15:59:57 +00:00
=dotspacemacs/user-config= function of your =.spacemacs= :
2015-11-16 13:49:50 +00:00
2016-01-31 19:53:55 +00:00
#+BEGIN_SRC emacs-lisp
2018-09-19 03:54:47 +00:00
(setq sentence-end-double-space t)
2016-01-31 19:53:55 +00:00
#+END_SRC
2015-11-16 13:49:50 +00:00
2015-11-16 20:06:43 +00:00
** Prevent the visual selection overriding my system clipboard?
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-config= of your
=.spacemacs= :
2016-01-31 19:53:55 +00:00
#+BEGIN_SRC emacs-lisp
2018-09-19 03:54:47 +00:00
(fset 'evil-visual-update-x-selection 'ignore)
2016-01-31 19:53:55 +00:00
#+END_SRC
2015-11-16 20:06:43 +00:00
2015-11-28 17:05:05 +00:00
** Make spell-checking support curly quotes (or any other character)?
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 the =dotspacemacs/user-config= of your =.spacemacs= :
2016-01-31 19:53:55 +00:00
#+BEGIN_SRC emacs-lisp
2018-09-19 03:54:47 +00:00
(add-to-list 'ispell-local-dictionary-alist
(quote ("my_english" "[[:alpha: ]]" "[^[:alpha:]]" "['’ ]" t ("-d" "en_US") nil utf-8)))
2016-01-31 19:53:55 +00:00
#+END_SRC
2015-11-28 17:05:05 +00:00
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 of
=ispell-dictionary-alist= for more details about the possibilities.
You finally have to set =my_english= as your =ispell-local-dictionary= in order
to use the dictionary supporting your newly added characters.
2015-12-21 12:56:38 +00:00
** Use Spacemacs as the =$EDITOR= for git commits?
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 your
=dotspacemacs/user-config= :
2016-01-31 19:53:55 +00:00
#+BEGIN_SRC emacs-lisp
2018-09-19 03:54:47 +00:00
(global-git-commit-mode t)
2016-01-31 19:53:55 +00:00
#+END_SRC
2015-12-21 12:56:38 +00:00
2016-01-30 07:36:03 +00:00
** Try Spacemacs without modifying my existing Emacs configuration?
2019-05-26 20:58:52 +00:00
Emacs's ability to use any directory as the home for launching it allows us to
2016-01-31 19:35:53 +00:00
try out Spacemacs (or any other Emacs configuration we desire) without having to
go through the trouble of backing up our =~/.emacs.d= directory and then cloning
the new configuration. This can be achieved easily using the following steps:
2016-01-30 07:36:03 +00:00
2016-01-31 19:53:55 +00:00
#+BEGIN_SRC sh
2018-09-19 03:54:47 +00:00
mkdir ~/spacemacs
git clone https://github.com/syl20bnr/spacemacs.git ~/spacemacs/ .emacs.d
HOME=~/spacemacs emacs
2016-01-30 07:36:03 +00:00
#+END_SRC
2019-05-26 20:58:52 +00:00
If you're on Fish shell, you will need to modify the last command to:
2016-01-31 19:35:53 +00:00
=env HOME= $HOME/spacemacs emacs=
2016-01-30 07:36:03 +00:00
2016-02-01 17:41:34 +00:00
** Make copy/paste working with the mouse in X11 terminals?
It 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= :
2018-09-19 03:54:47 +00:00
#+BEGIN_SRC emacs-lisp
(xterm-mouse-mode -1)
#+END_SRC
2016-02-01 17:41:34 +00:00
2016-02-01 18:08:11 +00:00
** Use =helm-ag= to search only in files of a certain type?
It is possible to restrict the scope of =helm-ag= to search only expressions in
2016-05-26 11:19:04 +00:00
some specified file types. There are two ways of doing this, both by appending
2016-02-01 18:08:11 +00:00
some expressions to the search input:
- By using a regexp with =-G= , for instance =-G\.el$= will look for all files
ending with =.el= which are emacs-lisp files.
- By using a flag like =--python= which should be self-explaining. The list of
2017-05-01 19:56:04 +00:00
available flags could be accessed from terminal with:
2016-02-01 18:08:11 +00:00
2018-09-19 03:54:47 +00:00
#+BEGIN_SRC shell
ag --list-file-types
#+END_SRC
2016-02-01 18:08:11 +00:00
This is possible because =helm-ag= is treating the search input as command-line
arguments of the =ag= program.
2016-07-02 22:03:54 +00:00
** Modify spacemacs documentation look (space-doc-mode)
You can modify the list of visual enhancements applied by the =space-doc-mode= :
2018-07-10 10:57:25 +00:00
2016-07-02 22:03:54 +00:00
#+BEGIN_SRC emacs-lisp
2018-09-19 03:54:47 +00:00
(setq spacemacs-space-doc-modificators
'(center-buffer-mode
org-indent-mode
view-mode
hide-line-numbers
alternative-emphasis
alternative-tags-look
link-protocol
org-block-line-face-remap
org-kbd-face-remap
resize-inline-images))
2016-07-02 22:03:54 +00:00
#+END_SRC
2018-07-10 10:57:25 +00:00
2016-08-29 15:52:06 +00:00
By default only =center-buffer-mode= is disabled.
Both =space-doc-mode= and =center-buffer-mode= can be customized
2019-05-26 20:58:52 +00:00
with "Easy Customization Interface".
2016-07-02 22:03:54 +00:00
2016-03-14 13:18:31 +00:00
** Remap paste key to be able to paste copied text multiple times
In vim and evil, pasting over a text would cause it to be copied, hence making it impossible to paste
the same text multiple times.
To fix this, add the following snippet to your ~user-config~ :
2018-07-10 10:57:25 +00:00
2016-03-14 13:18:31 +00:00
#+BEGIN_SRC emacs-lisp
2018-09-19 03:54:47 +00:00
(defun evil-paste-after-from-0 ()
(interactive)
(let ((evil-this-register ?0))
(call-interactively 'evil-paste-after)))
2016-03-14 13:18:31 +00:00
2018-09-19 03:54:47 +00:00
(define-key evil-visual-state-map "p" 'evil-paste-after-from-0)
2016-03-14 13:18:31 +00:00
#+END_SRC
2015-10-30 11:20:58 +00:00
* Windows
** Why do the fonts look crappy on Windows?
2016-03-18 21:03:30 +00:00
You can install [[https://code.google.com/archive/p/gdipp/ ][GDIPP ]] (simplest) or [[https://code.google.com/p/mactype/ ][MacType ]] (more complete) on Windows to get
very nice looking fonts. It is also recommended to disable smooth scrolling on
Windows.
2015-09-23 03:26:12 +00:00
2015-10-30 11:20:58 +00:00
** Why is there no Spacemacs logo in the startup buffer?
2016-01-31 19:35:53 +00:00
A GUI build of emacs supporting image display is required. You can follow the
instructions [[http://stackoverflow.com/questions/2650041/emacs-under-windows-and-png-files ][here ]]. Alternatively you can download binaries of emacs with image
support included such as [[http://emacsbinw64.sourceforge.net/ ][this one ]].
2015-09-23 03:26:12 +00:00
2015-10-30 11:20:58 +00:00
** Why are all packages unavailable?
2015-09-30 09:47:53 +00:00
Check if your Emacs has HTTPS capabilities by doing =M-:= and then:
2016-01-31 19:53:55 +00:00
#+BEGIN_SRC emacs-lisp
2015-09-30 09:47:53 +00:00
(gnutls-available-p)
2016-01-31 19:53:55 +00:00
#+END_SRC
2015-09-30 09:47:53 +00:00
2016-02-20 01:07:19 +00:00
If this returns =nil= , you need to install the GnuTLS DLL file in the same
2015-09-30 09:47:53 +00:00
directory as Emacs. See [[https://www.gnu.org/software/emacs/manual/html_mono/emacs-gnutls.html#Help-For-Users ][here ]] for instructions.
2016-04-13 03:31:38 +00:00
** The powerline isn't shown correctly when Spacemacs is used within =PuTTY=
2017-05-22 14:05:05 +00:00
You can follow [[http://mschulte.nl/posts/using-powerline-in-PuTTY.html ][this explanation ]] explaining how to correct this.