Add dotspacemacs-enable-paste-micro-state (default to t)

This commit is contained in:
syl20bnr 2015-03-09 20:57:58 -04:00
parent c5c861bc2a
commit 7b3a9c62a3
3 changed files with 15 additions and 0 deletions

View File

@ -60,6 +60,10 @@ size to make separators look not too crappy.")
By default the command key is `:' so ex-commands are executed like in Vim
with `:' and Emacs commands are executed with `<leader> :'.")
(defvar dotspacemacs-enable-paste-micro-state t
"If non nil the paste micro-state is enabled. While enabled pressing `p`
several times cycle between the kill ring content.'")
(defvar dotspacemacs-guide-key-delay 0.4
"Guide-key delay in seconds.")

View File

@ -58,6 +58,9 @@ before layers configuration."
;; By default the command key is `:' so ex-commands are executed like in Vim
;; with `:' and Emacs commands are executed with `<leader> :'.
dotspacemacs-command-key ":"
;; If non nil the paste micro-state is enabled. While enabled pressing `p`
;; several times cycle between the kill ring content.
dotspacemacs-enable-paste-micro-state t
;; Guide-key delay in seconds. The Guide-key is the popup buffer listing
;; the commands bound to the current keystrokes.
dotspacemacs-guide-key-delay 0.4

View File

@ -690,6 +690,14 @@ which require an initialization must be listed explicitly in the list.")
:bindings
("p" evil-paste-pop)
("P" evil-paste-pop-next))
(unless dotspacemacs-enable-paste-micro-state
(ad-disable-advice 'evil-paste-before 'after 'spacemacs/evil-paste-before)
(ad-activate 'evil-paste-before)
(ad-disable-advice 'evil-paste-after 'after 'spacemacs/evil-paste-after)
(ad-activate 'evil-paste-after)
(ad-disable-advice 'evil-visual-paste 'after 'spacemacs/evil-visual-paste)
(ad-activate 'evil-visual-paste))
;; define text objects
(defmacro spacemacs|define-and-bind-text-object (key name start-regex end-regex)