From 9539e4206d3861a4f6f4cb13967fb3b5c1f7ff95 Mon Sep 17 00:00:00 2001 From: syl20bnr Date: Fri, 8 Jun 2018 01:33:03 -0400 Subject: [PATCH] Rename Vim style related variable to vim-style-xxxxx Update the documentation Define alias for backward compatibility --- core/core-dotspacemacs.el | 13 ------------- core/templates/.spacemacs.template | 15 --------------- doc/DOCUMENTATION.org | 18 +++++++++++++----- .../spacemacs-bootstrap/config.el | 18 ++++++++++++++++++ layers/+spacemacs/spacemacs-evil/packages.el | 2 +- 5 files changed, 32 insertions(+), 34 deletions(-) diff --git a/core/core-dotspacemacs.el b/core/core-dotspacemacs.el index 263ed4bb9..f3e669259 100644 --- a/core/core-dotspacemacs.el +++ b/core/core-dotspacemacs.el @@ -226,19 +226,6 @@ emacs.") "Default font, or prioritized list of fonts. This setting has no effect when running Emacs in terminal.") -(defvar dotspacemacs-remap-Y-to-y$ nil - "If non nil `Y' is remapped to `y$' in Evil states.") - -(defvar dotspacemacs-retain-visual-state-on-shift t - "If non-nil, the shift mappings `<' and `>' retain visual state -if used there.") - -(defvar dotspacemacs-visual-line-move-text nil - "If non-nil, J and K move lines up and down when in visual mode.") - -(defvar dotspacemacs-ex-substitute-global nil - "If non nil, inverse the meaning of `g' in `:substitute' Evil ex-command.") - (defvar dotspacemacs-folding-method 'evil "Code folding method. Possible values are `evil' and `origami'.") diff --git a/core/templates/.spacemacs.template b/core/templates/.spacemacs.template index a6cc56d04..8e14f1641 100644 --- a/core/templates/.spacemacs.template +++ b/core/templates/.spacemacs.template @@ -238,21 +238,6 @@ It should only modify the values of Spacemacs settings." ;; works in the GUI. (default nil) dotspacemacs-distinguish-gui-tab nil - ;; If non-nil `Y' is remapped to `y$' in Evil states. (default nil) - dotspacemacs-remap-Y-to-y$ nil - - ;; If non-nil, the shift mappings `<' and `>' retain visual state if used - ;; there. (default t) - dotspacemacs-retain-visual-state-on-shift t - - ;; If non-nil, `J' and `K' move lines up and down when in visual mode. - ;; (default nil) - dotspacemacs-visual-line-move-text nil - - ;; If non-nil, inverse the meaning of `g' in `:substitute' Evil ex-command. - ;; (default nil) - dotspacemacs-ex-substitute-global nil - ;; Name of the default layout (default "Default") dotspacemacs-default-layout-name "Default" diff --git a/doc/DOCUMENTATION.org b/doc/DOCUMENTATION.org index e35ce72ae..d391d91d1 100644 --- a/doc/DOCUMENTATION.org +++ b/doc/DOCUMENTATION.org @@ -756,15 +756,23 @@ When setting the Vim style you can pass any variable supported by =evil-mode= with the keyword =:variables=. Spacemacs also supports the followgin editing style variables for Vim: -| Variable | Description | -|-----------------------------+---------------------------------------------| -| =vim-style-visual-feedback= | If non-nil then brief highlights on objects | +| Variables | Description | +|------------------------------------------+-------------------------------------------------------------------------| +| =vim-style-visual-feedback= | If non-nil then objects are briefly highlighted | +| =vim-style-remap-Y-to-y$= | If non-nil ~Y~ is remapped to ~y$~ in Evil states | +| =vim-style-retain-visual-state-on-shift= | If non-nil, the shift mappings ~<~ and ~>~ retain visual state | +| =vim-style-visual-line-move-text= | If non-nil, ~J~ and ~K~ move lines up and down when in visual mode | +| =vim-style-ex-substitute-global= | If non-nil, inverse the meaning of ~g~ in =:substitute= Evil ex-command | Default configuration is: #+BEGIN_SRC emacs-lisp -(setq-default dotspacemacs-editing-style '(vim :variables - vim-style-visual-feedback t) + (setq-default dotspacemacs-editing-style '(vim :variables + vim-style-visual-feedback t + vim-style-remap-Y-to-y$ nil + vim-style-retain-visual-state-on-shift t + vim-style-visual-line-move-text nil + vim-style-ex-substitute-global nil) #+END_SRC *** Emacs diff --git a/layers/+distributions/spacemacs-bootstrap/config.el b/layers/+distributions/spacemacs-bootstrap/config.el index 6a518d80b..b09e48e66 100644 --- a/layers/+distributions/spacemacs-bootstrap/config.el +++ b/layers/+distributions/spacemacs-bootstrap/config.el @@ -46,6 +46,24 @@ to a major mode, a list of such symbols, or the symbol t, acting as default. The values are either integers, symbols or lists of these.") +(defvar vim-style-remap-Y-to-y$ nil + "If non nil `Y' is remapped to `y$' in Evil states.") +(defvaralias 'dotspacemacs-remap-Y-to-y$ 'vim-style-remap-Y-to-y$) + +(defvar vim-style-retain-visual-state-on-shift t + "If non-nil, the shift mappings `<' and `>' retain visual state +if used there.") +(defvaralias 'dotspacemacs-retain-visual-state-on-shift + 'vim-style-retain-visual-state-on-shift) + +(defvar vim-style-visual-line-move-text nil + "If non-nil, J and K move lines up and down when in visual mode.") +(defvaralias 'dotspacemacs-visual-line-move-text 'vim-style-visual-line-move-text) + +(defvar vim-style-ex-substitute-global nil + "If non nil, inverse the meaning of `g' in `:substitute' Evil ex-command.") +(defvaralias 'dotspacemacs-ex-substitute-global 'vim-style-ex-substitute-global) + ;; State cursors (defvar spacemacs-evil-cursors '(("normal" "DarkGoldenrod2" box) ("insert" "chartreuse3" (bar . 2)) diff --git a/layers/+spacemacs/spacemacs-evil/packages.el b/layers/+spacemacs/spacemacs-evil/packages.el index 8005f6866..79df0299c 100644 --- a/layers/+spacemacs/spacemacs-evil/packages.el +++ b/layers/+spacemacs/spacemacs-evil/packages.el @@ -119,7 +119,7 @@ evil-goggles-blocking-duration 0.05) (if vim-style-visual-feedback (evil-goggles-mode) - (evil-googles-mode -1))) + (evil-goggles-mode -1))) :config (spacemacs|hide-lighter evil-goggles-mode)))