spacemacs/layers/+emacs/better-defaults
Rory O’Kane 18952625cc
Fix wrong filename in a layer file’s header comment
the header of `keybindings.el` in the `better-defaults` layer
2016-09-13 13:22:59 +03:00
..
img layers directory: create new categories 2016-03-23 21:39:43 -04:00
README.org improve mwim integration 2016-06-27 15:21:31 +03:00
config.el improve mwim integration 2016-06-27 15:21:31 +03:00
funcs.el Add mwim to layer better-defaults 2016-06-27 15:16:31 +03:00
keybindings.el Fix wrong filename in a layer file’s header comment 2016-09-13 13:22:59 +03:00
packages.el Add mwim to layer better-defaults 2016-06-27 15:16:31 +03:00

README.org

Better Defaults layer

/TakeV/spacemacs/media/commit/655d737d4a9a2cec4cbf2cde26cc30b28b2d36a0/layers/+emacs/better-defaults/img/emacs.png

Description

This layer enhances the default commands of Emacs and is primarily intended to be used with the emacs editing style as it does not change anything in the Vim key bindings.

However the emacs editing style is not required, you can still use this layer while you are using the vim editing style if you have some kind of mixed style.

The commands defined in this layer are taken from various sources like Prelude.

Features

Smart line navigation

Subsequent presses of C-a toggles between the beginning of the line and the first non-whitespace character.

Similarly, subsequent presses of C-e will toggle between the end of the code and the end of the comments.

spacemacs/backward-kill-word-or-region

A combination of kill-region and backward-kill-word, depending on whether there is an active region. If there's an active region kill that. If not kill the preceding word.

Install

To use this configuration layer, add it to your ~/.spacemacs. You will need to add better-defaults to the existing dotspacemacs-configuration-layers list in this file.

Configuration

Choose if C-a first brings you to the beginning of the line or the beginning of the code (first non-whitespace character).

  (better-defaults :variables
                   better-defaults-move-to-beginning-of-code-first t)

Choose if C-e first brings you to the end of the line or the end of the code (before or after comments).

  (better-defaults :variables
                   better-defaults-move-to-end-of-code-first nil)

Key bindings

Key Binding Description
C-a move to beginning of line or code
C-e move to end of line or code
C-w backward kill word or region
C-y Automatically indenting after pasting. With prefix argument, paste text as it is