Merge `HOWTOs.org` in `FAQ.org`

Merging the HOW-TOs inside the FAQ allows to have a central place to
look for information. It will also offer all HOW-TOs through the
`SPC f e h` helm search.
This commit is contained in:
Fabien Dubosson 2015-10-18 21:21:46 +02:00 committed by syl20bnr
parent 70ecefe79b
commit 0fb5e24039
2 changed files with 92 additions and 94 deletions

View File

@ -11,6 +11,13 @@
- [[#how-can-i-change-or-define-an-alias-for-an-evil-leader-prefix-][How can I change or define an alias for an =evil-leader= prefix ?]]
- [[#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?]]
- [[#how-do-i][How do I]]
- [[#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?]]
- [[#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 ?]]
@ -85,6 +92,91 @@ repository instead of the one shipped with emacs. Then, any `org` related code
should not be loaded before `dotspacemacs/user-config`, otherwise both versions
will be loaded and will conflict.
** How do I
*** Disable a package completely?
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:
#+begin_src emacs-lisp
(setq-default dotspacemacs-excluded-packages '(package1 package2 ...))
#+end_src
*** Disable a package only for a specific major-mode?
This is done by removing the hook added by Spacemacs. For example to
remove =flycheck= support in python buffers, look for the function
=dotspacemacs/user-config= in your dotfile and add the following code:
#+begin_src emacs-lisp
(remove-hook 'python-mode-hook 'flycheck-mode)
#+end_src
*Hint* to know the name of the major-mode of the current buffer press:
~SPC h d v major-mode RET~
*** Disable company for a specific major-mode?
It may be handy to disable =company= for a given mode if you plan on
configuring =auto-complete= instead. On 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=:
#+begin_src emacs-lisp
(spacemacs|disable-company python-mode)
#+end_src
*** Change special buffer rules?
To change the way spacemacs marks buffers as useless, you can customize
=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.
Examples:
#+begin_src emacs-lisp
;; Only mark helm buffers as useless
(setq spacemacs-useless-buffers-regexp '("\\*helm\.\+\\*"))
;; Marking the *Messages* buffer as useful
(push "\\*Messages\\*" spacemacs-useful-buffers-regexp)
#+end_src
*** Enable navigation by visual lines?
Add the following snippet to your =dostpacemacs/config= function:
#+begin_src emacs-lisp
;; 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)
#+end_src
*** Disable evilification of a mode?
You can ensure a mode opens in emacs state by using =evil-set-initial-state=.
#+begin_src emacs-lisp
(evil-set-initial-state 'magit-status-mode 'emacs)
#+end_src
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
#+begin_src emacs-lisp
(push '("*magit" . emacs) evil-buffer-regexps)
#+end_src
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=,
#+begin_src emacs-lisp
(define-key magit-status-mode-map
dotspacemacs-leader-key evil-leader--default-map)
#+end_src
** Windows
*** Why do the fonts look crappy on Windows ?
You can install [[https://code.google.com/p/mactype/][MacType]] on Windows to get very nice looking fonts. It is

View File

@ -1,94 +0,0 @@
* Compilation of quick HOW-TOs for Spacemacs
** Table of Contents :TOC@4:
- [[#compilation-of-quick-how-tos-for-spacemacs][Compilation of quick HOW-TOs for Spacemacs]]
- [[#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]]
** Disable a package completely
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:
#+begin_src emacs-lisp
(setq-default dotspacemacs-excluded-packages '(package1 package2 ...))
#+end_src
** Disable a package only for a specific major-mode
This is done by removing the hook added by Spacemacs. For example to
remove =flycheck= support in python buffers, look for the function
=dotspacemacs/user-config= in your dotfile and add the following code:
#+begin_src emacs-lisp
(remove-hook 'python-mode-hook 'flycheck-mode)
#+end_src
*Hint* to know the name of the major-mode of the current buffer press:
~SPC h d v major-mode RET~
** Disable company for a specific major-mode
It may be handy to disable =company= for a given mode if you plan on
configuring =auto-complete= instead. On 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=:
#+begin_src emacs-lisp
(spacemacs|disable-company python-mode)
#+end_src
** Change special buffer rules
To change the way spacemacs marks buffers as useless, you can customize
=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.
Examples:
#+begin_src emacs-lisp
;; Only mark helm buffers as useless
(setq spacemacs-useless-buffers-regexp '("\\*helm\.\+\\*"))
;; Marking the *Messages* buffer as useful
(push "\\*Messages\\*" spacemacs-useful-buffers-regexp)
#+end_src
** Enable navigation by visual lines
Add the following snippet to your =dostpacemacs/config= function:
#+begin_src emacs-lisp
;; 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)
#+end_src
** Disable evilification of a mode
You can ensure a mode opens in emacs state by using =evil-set-initial-state=.
#+begin_src emacs-lisp
(evil-set-initial-state 'magit-status-mode 'emacs)
#+end_src
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
#+begin_src emacs-lisp
(push '("*magit" . emacs) evil-buffer-regexps)
#+end_src
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=,
#+begin_src emacs-lisp
(define-key magit-status-mode-map
dotspacemacs-leader-key evil-leader--default-map)
#+end_src