From 237d1143d125809f11dbea753f5ca1c69adc9719 Mon Sep 17 00:00:00 2001 From: d12frosted Date: Mon, 27 Jun 2016 15:21:31 +0300 Subject: [PATCH] improve mwim integration 1. By default let `C-e` move to the end of line first. 2. Minor improvements to readme file --- layers/+emacs/better-defaults/README.org | 33 ++++++++++++++---------- layers/+emacs/better-defaults/config.el | 2 +- 2 files changed, 21 insertions(+), 14 deletions(-) diff --git a/layers/+emacs/better-defaults/README.org b/layers/+emacs/better-defaults/README.org index 1986f89c5..97b42b98e 100644 --- a/layers/+emacs/better-defaults/README.org +++ b/layers/+emacs/better-defaults/README.org @@ -24,30 +24,37 @@ The commands defined in this layer are taken from various sources like [[https:/ * 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. +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. +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. +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) +Choose if ~C-a~ first brings you to the beginning of the line or the beginning of +the code (first non-whitespace character). + #+BEGIN_SRC emacs-lisp - (better-defaults :variables - better-defaults-move-to-beginning-of-code-first t) + (better-defaults :variables + better-defaults-move-to-beginning-of-code-first t) #+END_SRC -Choose if ~C-e~ first brings you to the end of the line or the end of the code (before or after comments) +Choose if ~C-e~ first brings you to the end of the line or the end of the code +(before or after comments). + #+BEGIN_SRC emacs-lisp - (better-defaults :variables - better-defaults-move-to-end-of-code-first t) + (better-defaults :variables + better-defaults-move-to-end-of-code-first nil) #+END_SRC diff --git a/layers/+emacs/better-defaults/config.el b/layers/+emacs/better-defaults/config.el index 58ea6bf77..8741cc874 100644 --- a/layers/+emacs/better-defaults/config.el +++ b/layers/+emacs/better-defaults/config.el @@ -14,7 +14,7 @@ When nil, first stroke will go to the beginning of line. Subsequent strokes will toggle between beginning of line and beginning of code.") -(defvar better-defaults-move-to-end-of-code-first t +(defvar better-defaults-move-to-end-of-code-first nil "when t, first stroke of C-e will move the cursor to the end of code (before comments). When nil, first stroke will go to the end of line (after comments). Subsequent strokes will toggle between end of line and end of code.")