diff --git a/README.md b/README.md index 046c96beb..14badced7 100644 --- a/README.md +++ b/README.md @@ -314,9 +314,13 @@ the documentation for more details. ## Editing Styles Spacemacs can be used by Vim users or Emacs users by setting the -`dotspacemacs-editing-style` variable to `vim` or `emacs` in the dotfile +`dotspacemacs-editing-style` variable to `'vim` or `'emacs` in the dotfile `~/.spacemacs`. +You can also set the variable automatically when generating `.spacemacs` file by +executing the command M-x dotspacemacs/install. Spacemacs then asks +you an editing style and create `.spacemacs` file with appropriate editing style. + ## The leader key `Spacemacs` key bindings use a leader key which is by default bound to diff --git a/core/core-dotspacemacs.el b/core/core-dotspacemacs.el index d5e024680..ba1efdd5a 100644 --- a/core/core-dotspacemacs.el +++ b/core/core-dotspacemacs.el @@ -188,8 +188,13 @@ before installing the file if the destination already exists." (format "%s already exists. Do you want to overwite it ? " dotfile)) t))) (when install - (copy-file (concat dotspacemacs-template-directory - ".spacemacs.template") dotfile t) + (with-current-buffer (find-file-noselect (concat dotspacemacs-template-directory + ".spacemacs.template")) + (re-search-forward "\$editing-style") + (replace-match (if (y-or-n-p "Do you want to use Vim style editing? (press \"n\" to choose Emacs)") + "'vim" + "'emacs")) + (write-file dotfile)) (message "%s has been installed." dotfile)))) (defun dotspacemacs/load-file () diff --git a/core/templates/.spacemacs.template b/core/templates/.spacemacs.template index f55c44d6c..070fa38f9 100644 --- a/core/templates/.spacemacs.template +++ b/core/templates/.spacemacs.template @@ -27,7 +27,7 @@ before layers configuration." (setq-default ;; Either `vim' or `emacs'. Evil is always enabled but if the variable ;; is `emacs' then the `holy-mode' is enabled at startup. - dotspacemacs-editing-style 'vim + dotspacemacs-editing-style $editing-style ;; Specify the startup banner. Default value is `official', it displays ;; the official spacemacs logo. An integer value is the index of text ;; banner, `random' chooses a random text banner in `core/banners'