2016-01-30 18:53:20 +00:00
|
|
|
;;; packages.el --- Spacemacs Evil Layer packages File
|
|
|
|
;;
|
2018-01-04 07:00:25 +00:00
|
|
|
;; Copyright (c) 2012-2018 Sylvain Benner & Contributors
|
2016-01-30 18:53:20 +00:00
|
|
|
;;
|
|
|
|
;; Author: Sylvain Benner <sylvain.benner@gmail.com>
|
|
|
|
;; URL: https://github.com/syl20bnr/spacemacs
|
|
|
|
;;
|
|
|
|
;; This file is not part of GNU Emacs.
|
|
|
|
;;
|
|
|
|
;;; License: GPLv3
|
|
|
|
|
|
|
|
(setq spacemacs-evil-packages
|
2018-11-05 11:31:55 +00:00
|
|
|
'(
|
|
|
|
evil-anzu
|
2016-01-30 18:53:20 +00:00
|
|
|
evil-args
|
2018-01-04 06:34:23 +00:00
|
|
|
evil-cleverparens
|
2018-08-27 15:21:17 +00:00
|
|
|
evil-ediff
|
2018-03-05 01:36:40 +00:00
|
|
|
evil-escape
|
2016-01-30 18:53:20 +00:00
|
|
|
evil-exchange
|
2018-06-02 06:51:06 +00:00
|
|
|
evil-goggles
|
2016-01-30 18:53:20 +00:00
|
|
|
evil-iedit-state
|
|
|
|
evil-indent-plus
|
2017-03-21 00:43:04 +00:00
|
|
|
evil-lion
|
2016-01-30 18:53:20 +00:00
|
|
|
evil-lisp-state
|
|
|
|
evil-nerd-commenter
|
|
|
|
evil-matchit
|
|
|
|
evil-numbers
|
2016-05-14 15:45:07 +00:00
|
|
|
evil-surround
|
2016-01-30 18:53:20 +00:00
|
|
|
;; Temporarily disabled, pending the resolution of
|
|
|
|
;; https://github.com/7696122/evil-terminal-cursor-changer/issues/8
|
2016-07-07 02:48:58 +00:00
|
|
|
;; evil-terminal-cursor-changer
|
2019-04-07 13:34:02 +00:00
|
|
|
evil-textobj-line
|
2016-01-30 18:53:20 +00:00
|
|
|
evil-tutor
|
2016-07-12 17:08:21 +00:00
|
|
|
(evil-unimpaired :location (recipe :fetcher local))
|
2016-05-14 15:45:07 +00:00
|
|
|
evil-visual-mark-mode
|
2018-03-05 01:36:40 +00:00
|
|
|
evil-visualstar
|
2016-05-14 15:45:07 +00:00
|
|
|
(hs-minor-mode :location built-in)
|
2018-05-10 17:10:31 +00:00
|
|
|
(linum-relative :toggle (version< emacs-version "26"))
|
2016-05-14 15:45:07 +00:00
|
|
|
vi-tilde-fringe
|
|
|
|
))
|
2016-01-30 18:53:20 +00:00
|
|
|
|
|
|
|
(defun spacemacs-evil/init-evil-anzu ()
|
|
|
|
(use-package evil-anzu
|
|
|
|
:init
|
|
|
|
(global-anzu-mode t)
|
|
|
|
:config
|
|
|
|
(progn
|
|
|
|
(spacemacs|hide-lighter anzu-mode)
|
|
|
|
(setq anzu-search-threshold 1000
|
|
|
|
anzu-cons-mode-line-p nil)
|
|
|
|
;; powerline integration
|
2017-07-02 13:48:06 +00:00
|
|
|
(when (configuration-layer/package-used-p 'spaceline)
|
2016-01-30 18:53:20 +00:00
|
|
|
(defun spacemacs/anzu-update-mode-line (here total)
|
|
|
|
"Custom update function which does not propertize the status."
|
|
|
|
(when anzu--state
|
2017-08-28 09:13:59 +00:00
|
|
|
(let ((status
|
|
|
|
(cl-case anzu--state
|
|
|
|
(search (format "(%s/%d%s)"
|
|
|
|
(anzu--format-here-position here total)
|
|
|
|
total (if anzu--overflow-p "+" "")))
|
|
|
|
(replace-query (format "(%d replace)" total))
|
|
|
|
(replace (format "(%d/%d)" here total)))))
|
2016-01-30 18:53:20 +00:00
|
|
|
status)))
|
2017-08-28 09:13:59 +00:00
|
|
|
(setq anzu-mode-line-update-function
|
|
|
|
'spacemacs/anzu-update-mode-line)))))
|
2016-01-30 18:53:20 +00:00
|
|
|
|
|
|
|
(defun spacemacs-evil/init-evil-args ()
|
|
|
|
(use-package evil-args
|
2018-06-15 01:27:12 +00:00
|
|
|
:defer t
|
2016-01-30 18:53:20 +00:00
|
|
|
:init
|
|
|
|
(progn
|
|
|
|
;; bind evil-args text objects
|
|
|
|
(define-key evil-inner-text-objects-map "a" 'evil-inner-arg)
|
|
|
|
(define-key evil-outer-text-objects-map "a" 'evil-outer-arg))))
|
|
|
|
|
2018-01-04 06:34:23 +00:00
|
|
|
(defun spacemacs-evil/init-evil-cleverparens ()
|
|
|
|
(use-package evil-cleverparens
|
2018-03-04 04:37:53 +00:00
|
|
|
:defer t
|
2018-01-04 06:34:23 +00:00
|
|
|
:init
|
|
|
|
(progn
|
|
|
|
(setq evil-cleverparens-use-regular-insert t)
|
|
|
|
(eval `(spacemacs|add-toggle evil-safe-lisp-structural-editing
|
|
|
|
:if (memq dotspacemacs-editing-style '(vim hybrid))
|
|
|
|
:mode evil-cleverparens-mode
|
|
|
|
:documentation "Enable evil-cleverparens."
|
|
|
|
:evil-leader-for-mode
|
|
|
|
,@(mapcar (lambda (x) (cons x "Ts"))
|
|
|
|
evil-lisp-safe-structural-editing-modes)))
|
|
|
|
(spacemacs|diminish evil-cleverparens-mode " 🆂" " [s]"))))
|
|
|
|
|
2016-05-14 15:45:07 +00:00
|
|
|
(defun spacemacs-evil/init-evil-ediff ()
|
|
|
|
(use-package evil-ediff
|
|
|
|
:after (ediff)
|
|
|
|
:if (memq dotspacemacs-editing-style '(hybrid vim))))
|
|
|
|
|
2018-03-05 01:36:40 +00:00
|
|
|
(defun spacemacs-evil/init-evil-escape ()
|
|
|
|
(use-package evil-escape
|
2018-06-15 01:40:05 +00:00
|
|
|
:defer t
|
2018-06-02 05:56:25 +00:00
|
|
|
:init
|
2018-06-15 07:09:14 +00:00
|
|
|
(add-hook 'emacs-startup-hook
|
|
|
|
(lambda ()
|
|
|
|
(spacemacs|add-transient-hook evil-normal-state-exit-hook
|
|
|
|
(lambda () (require 'evil-escape))
|
|
|
|
lazy-load-evil-escape-1)
|
|
|
|
(spacemacs|add-transient-hook window-configuration-change-hook
|
|
|
|
(lambda () (require 'evil-escape))
|
|
|
|
lazy-load-evil-escape-2)))
|
2018-06-15 01:40:05 +00:00
|
|
|
:config
|
2018-06-02 05:56:25 +00:00
|
|
|
(progn
|
|
|
|
(add-hook 'spacemacs-editing-style-hook #'spacemacs//evil-escape-deactivate-in-holy-mode)
|
|
|
|
;; apply once when emacs starts
|
2018-06-15 01:40:05 +00:00
|
|
|
(spacemacs//evil-escape-deactivate-in-holy-mode dotspacemacs-editing-style)
|
|
|
|
(spacemacs|hide-lighter evil-escape-mode))))
|
2018-03-05 01:36:40 +00:00
|
|
|
|
2016-01-30 18:53:20 +00:00
|
|
|
(defun spacemacs-evil/init-evil-exchange ()
|
|
|
|
(use-package evil-exchange
|
2018-06-15 01:30:34 +00:00
|
|
|
:defer t
|
|
|
|
:init
|
|
|
|
(progn
|
|
|
|
(let ((evil-exchange-key (kbd "gx"))
|
|
|
|
(evil-exchange-cancel-key (kbd "gX")))
|
|
|
|
(define-key evil-normal-state-map evil-exchange-key 'evil-exchange)
|
|
|
|
(define-key evil-visual-state-map evil-exchange-key 'evil-exchange)
|
|
|
|
(define-key evil-normal-state-map evil-exchange-cancel-key
|
|
|
|
'evil-exchange-cancel)
|
|
|
|
(define-key evil-visual-state-map evil-exchange-cancel-key
|
|
|
|
'evil-exchange-cancel)))))
|
2016-01-30 18:53:20 +00:00
|
|
|
|
2018-06-02 06:51:06 +00:00
|
|
|
(defun spacemacs-evil/init-evil-goggles ()
|
|
|
|
(use-package evil-goggles
|
2018-06-15 01:23:12 +00:00
|
|
|
:defer t
|
2018-06-02 06:51:06 +00:00
|
|
|
:init
|
|
|
|
(progn
|
2018-06-03 06:21:21 +00:00
|
|
|
;; disable pulses as it is more distracting than useful and
|
|
|
|
;; less readable.
|
|
|
|
(setq evil-goggles-pulse nil
|
2018-06-08 05:14:06 +00:00
|
|
|
evil-goggles-async-duration 0.1
|
|
|
|
evil-goggles-blocking-duration 0.05)
|
2018-06-15 01:23:12 +00:00
|
|
|
(when (or vim-style-visual-feedback
|
|
|
|
hybrid-style-visual-feedback)
|
|
|
|
(spacemacs|add-transient-hook evil-operator-state-entry-hook
|
|
|
|
(lambda () (require 'evil-goggles))
|
|
|
|
lazy-load-evil-googles)))
|
|
|
|
:config
|
|
|
|
(progn
|
2018-06-08 06:32:05 +00:00
|
|
|
(if (or vim-style-visual-feedback
|
|
|
|
hybrid-style-visual-feedback)
|
2018-06-08 05:14:06 +00:00
|
|
|
(evil-goggles-mode)
|
2018-06-15 01:23:12 +00:00
|
|
|
(evil-goggles-mode -1))
|
|
|
|
(spacemacs|hide-lighter evil-goggles-mode))))
|
2018-06-02 06:51:06 +00:00
|
|
|
|
2016-01-30 18:53:20 +00:00
|
|
|
(defun spacemacs-evil/init-evil-iedit-state ()
|
|
|
|
(use-package evil-iedit-state
|
|
|
|
:commands (evil-iedit-state evil-iedit-state/iedit-mode)
|
Use evil in holy-mode
Motivation
While disabling Evil in holy-mode makes its implementation shorter and
sounds elegant on the paper, in practice it puts a big burden on the
configuration parts which need to know if Evil is enable or not. This is
a bad separation of concerns and the bunch of fixes that we were forced
to do in the past weeks shows this issue. Those fixes were about
removing the knowledge of the activation of Evil by implementing new
dispatching functions to be used by layers, this is cumbersome and makes
Spacemacs layer configuration more subtle which is not good. There was
additional bad consequences of the removal of Evil state like the
impossibility to use Evil lisp state or iedit states, or we would have
been forced to implement a temporary activation of Evil which is
awkward.
Instead I reintroduce Evil as the central piece of Spacemacs design thus
Evil is now re-enabled in holy-mode. It provides the abstraction we need
to isolate editing styles and be able to grow the Spacemacs
configuration coverage sanely. Layers don't need to check whether the
holy mode is active or not and they don't need to know if Evil is
available (it is always available). We also don't need to write
additional dispatching functions, this is the job of Evil, and I think
it provides everything for this. Ideally configuration layer should be
implemented with only Evil in mind and the holy-mode (and hybrid-mode)
should magically make it work for Emacs style users, for instance we can
freely use `evil-insert-state` anywhere in the code without any guard.
Evil is now even more part of Spacemacs, we can really say that
Spacemacs is Emacs+Evil which is now an indivisible pair. Spacemacs
needed this stable API to continue on the right track.
While these changes should be rather transparent to the user, I'm sorry
for this experimental period, I failed to see all the implications of
such a change, I was just excited about the possibility to make Evil
optional. The reality is that Spacemacs has to embrace it and keep its
strong position on being Emacs+Evil at the core.
Implementation
- insert, motion and normal states are forced to emacs state using an
advice on `evil-insert-state`, `evil-motion-state` and
`evil-normal-state` respectively. These functions can be used freely in
the layer configuration.
- A new general hook `spacemacs-editing-style-hook` allow to hook any
code that need to be configured based on the editing style. Functions
hooked to this hook takes the current style as parameter, this
basically generalize the hook used to setup hjkl navigation bindings.
- ESC has been removed from the emacs state map.
- Revert unneeded changes
- Revert "evil: enter insert-state only from normal-state"
commit bdd702dfbe302206bbc989c7a0832daba087a781.
- Revert "avoid being evil in deft with emacs editing style"
commit f3a16f49ed27cc8cf05f23f93b006d6e04235381.
Additional changes
All editing style packages have been moved to a layer called
`spacemacs-editing-styles`
Notes
I did not have time to attack hybrid mode, I should be able to do it
later.
2016-03-13 23:41:18 +00:00
|
|
|
:init
|
|
|
|
(progn
|
|
|
|
(setq iedit-current-symbol-default t
|
|
|
|
iedit-only-at-symbol-boundaries t
|
|
|
|
iedit-toggle-key-default nil)
|
|
|
|
(spacemacs/set-leader-keys "se" 'evil-iedit-state/iedit-mode))
|
2016-01-30 18:53:20 +00:00
|
|
|
:config
|
2018-06-07 05:59:16 +00:00
|
|
|
(progn
|
|
|
|
;; set TAB action
|
|
|
|
(add-hook 'spacemacs-editing-style-hook
|
|
|
|
#'spacemacs//iedit-state-TAB-key-bindings)
|
|
|
|
(spacemacs//iedit-state-TAB-key-bindings dotspacemacs-editing-style)
|
|
|
|
;; activate leader in iedit and iedit-insert states
|
|
|
|
(define-key evil-iedit-state-map
|
|
|
|
(kbd dotspacemacs-leader-key) spacemacs-default-map)
|
|
|
|
(spacemacs//iedit-insert-state-hybrid dotspacemacs-editing-style)
|
|
|
|
(add-hook 'spacemacs-editing-style-hook
|
|
|
|
#'spacemacs//iedit-insert-state-hybrid))))
|
2016-01-30 18:53:20 +00:00
|
|
|
|
|
|
|
(defun spacemacs-evil/init-evil-indent-plus ()
|
|
|
|
(use-package evil-indent-plus
|
2018-06-15 01:28:33 +00:00
|
|
|
:defer t
|
|
|
|
:init
|
|
|
|
(progn
|
|
|
|
(define-key evil-inner-text-objects-map "i" 'evil-indent-plus-i-indent)
|
|
|
|
(define-key evil-outer-text-objects-map "i" 'evil-indent-plus-a-indent)
|
|
|
|
(define-key evil-inner-text-objects-map "I" 'evil-indent-plus-i-indent-up)
|
|
|
|
(define-key evil-outer-text-objects-map "I" 'evil-indent-plus-a-indent-up)
|
|
|
|
(define-key evil-inner-text-objects-map "J"
|
|
|
|
'evil-indent-plus-i-indent-up-down)
|
|
|
|
(define-key evil-outer-text-objects-map "J"
|
|
|
|
'evil-indent-plus-a-indent-up-down))))
|
2016-01-30 18:53:20 +00:00
|
|
|
|
2017-03-21 00:43:04 +00:00
|
|
|
(defun spacemacs-evil/init-evil-lion ()
|
|
|
|
(use-package evil-lion
|
2018-06-15 01:36:46 +00:00
|
|
|
:defer t
|
2017-05-23 09:08:06 +00:00
|
|
|
:init
|
|
|
|
(progn
|
2018-06-15 01:36:46 +00:00
|
|
|
;; Override the default keys, as they collide (with what ? :-))
|
2017-05-23 09:08:06 +00:00
|
|
|
(setq evil-lion-left-align-key nil
|
|
|
|
evil-lion-right-align-key nil)
|
|
|
|
(spacemacs/set-leader-keys
|
|
|
|
"xal" 'evil-lion-left
|
2018-06-15 01:36:46 +00:00
|
|
|
"xaL" 'evil-lion-right))
|
|
|
|
:config (evil-lion-mode)))
|
2017-03-21 00:43:04 +00:00
|
|
|
|
2016-01-30 18:53:20 +00:00
|
|
|
(defun spacemacs-evil/init-evil-lisp-state ()
|
|
|
|
(use-package evil-lisp-state
|
2018-06-11 06:46:38 +00:00
|
|
|
:defer t
|
|
|
|
:init
|
|
|
|
(progn
|
|
|
|
(add-hook 'prog-mode-hook 'spacemacs//load-evil-lisp-state)
|
|
|
|
(setq evil-lisp-state-global t))
|
2016-01-30 18:53:20 +00:00
|
|
|
:config (spacemacs/set-leader-keys "k" evil-lisp-state-map)))
|
|
|
|
|
|
|
|
;; other commenting functions in funcs.el with keybinds in keybindings.el
|
|
|
|
(defun spacemacs-evil/init-evil-nerd-commenter ()
|
|
|
|
(use-package evil-nerd-commenter
|
|
|
|
:commands evilnc-comment-operator
|
|
|
|
:init
|
|
|
|
(progn
|
|
|
|
;; double all the commenting functions so that the inverse operations
|
|
|
|
;; can be called without setting a flag
|
|
|
|
(defun spacemacs/comment-or-uncomment-lines-inverse (&optional arg)
|
|
|
|
(interactive "p")
|
|
|
|
(let ((evilnc-invert-comment-line-by-line t))
|
|
|
|
(evilnc-comment-or-uncomment-lines arg)))
|
|
|
|
|
|
|
|
(defun spacemacs/comment-or-uncomment-lines (&optional arg)
|
|
|
|
(interactive "p")
|
|
|
|
(let ((evilnc-invert-comment-line-by-line nil))
|
|
|
|
(evilnc-comment-or-uncomment-lines arg)))
|
|
|
|
|
|
|
|
(defun spacemacs/copy-and-comment-lines-inverse (&optional arg)
|
|
|
|
(interactive "p")
|
|
|
|
(let ((evilnc-invert-comment-line-by-line t))
|
|
|
|
(evilnc-copy-and-comment-lines arg)))
|
|
|
|
|
|
|
|
(defun spacemacs/copy-and-comment-lines (&optional arg)
|
|
|
|
(interactive "p")
|
|
|
|
(let ((evilnc-invert-comment-line-by-line nil))
|
|
|
|
(evilnc-copy-and-comment-lines arg)))
|
|
|
|
|
|
|
|
(defun spacemacs/quick-comment-or-uncomment-to-the-line-inverse
|
|
|
|
(&optional arg)
|
|
|
|
(interactive "p")
|
|
|
|
(let ((evilnc-invert-comment-line-by-line t))
|
|
|
|
(evilnc-comment-or-uncomment-to-the-line arg)))
|
|
|
|
|
|
|
|
(defun spacemacs/quick-comment-or-uncomment-to-the-line (&optional arg)
|
|
|
|
(interactive "p")
|
|
|
|
(let ((evilnc-invert-comment-line-by-line nil))
|
|
|
|
(evilnc-comment-or-uncomment-to-the-line arg)))
|
|
|
|
|
|
|
|
(defun spacemacs/comment-or-uncomment-paragraphs-inverse (&optional arg)
|
|
|
|
(interactive "p")
|
|
|
|
(let ((evilnc-invert-comment-line-by-line t))
|
|
|
|
(evilnc-comment-or-uncomment-paragraphs arg)))
|
|
|
|
|
|
|
|
(defun spacemacs/comment-or-uncomment-paragraphs (&optional arg)
|
|
|
|
(interactive "p")
|
|
|
|
(let ((evilnc-invert-comment-line-by-line nil))
|
|
|
|
(evilnc-comment-or-uncomment-paragraphs arg)))
|
|
|
|
|
|
|
|
(define-key evil-normal-state-map "gc" 'evilnc-comment-operator)
|
|
|
|
(define-key evil-normal-state-map "gy" 'spacemacs/copy-and-comment-lines)
|
|
|
|
|
|
|
|
(spacemacs/set-leader-keys
|
|
|
|
";" 'evilnc-comment-operator
|
|
|
|
"cl" 'spacemacs/comment-or-uncomment-lines
|
|
|
|
"cL" 'spacemacs/comment-or-uncomment-lines-inverse
|
|
|
|
"cp" 'spacemacs/comment-or-uncomment-paragraphs
|
|
|
|
"cP" 'spacemacs/comment-or-uncomment-paragraphs-inverse
|
|
|
|
"ct" 'spacemacs/quick-comment-or-uncomment-to-the-line
|
|
|
|
"cT" 'spacemacs/quick-comment-or-uncomment-to-the-line-inverse
|
|
|
|
"cy" 'spacemacs/copy-and-comment-lines
|
|
|
|
"cY" 'spacemacs/copy-and-comment-lines-inverse))))
|
|
|
|
|
|
|
|
(defun spacemacs-evil/init-evil-matchit ()
|
|
|
|
(use-package evil-matchit
|
2018-03-04 04:37:53 +00:00
|
|
|
:defer t))
|
2016-01-30 18:53:20 +00:00
|
|
|
|
|
|
|
(defun spacemacs-evil/init-evil-numbers ()
|
|
|
|
(use-package evil-numbers
|
2018-06-15 01:37:45 +00:00
|
|
|
:defer t
|
|
|
|
:init
|
2016-01-30 18:53:20 +00:00
|
|
|
(progn
|
|
|
|
(spacemacs|define-transient-state evil-numbers
|
|
|
|
:title "Evil Numbers Transient State"
|
2017-08-28 09:13:59 +00:00
|
|
|
:doc
|
|
|
|
"\n[_+_/_=_] increase number [_-_] decrease [0..9] prefix [_q_] quit"
|
2016-01-30 18:53:20 +00:00
|
|
|
:bindings
|
|
|
|
("+" evil-numbers/inc-at-pt)
|
|
|
|
("=" evil-numbers/inc-at-pt)
|
2016-09-04 16:51:12 +00:00
|
|
|
("-" evil-numbers/dec-at-pt)
|
2017-03-03 18:31:56 +00:00
|
|
|
("q" nil :exit t))
|
2016-01-30 18:53:20 +00:00
|
|
|
(spacemacs/set-leader-keys
|
|
|
|
"n+" 'spacemacs/evil-numbers-transient-state/evil-numbers/inc-at-pt
|
|
|
|
"n=" 'spacemacs/evil-numbers-transient-state/evil-numbers/inc-at-pt
|
|
|
|
"n-" 'spacemacs/evil-numbers-transient-state/evil-numbers/dec-at-pt))))
|
|
|
|
|
2016-05-14 15:45:07 +00:00
|
|
|
(defun spacemacs-evil/init-evil-surround ()
|
|
|
|
(use-package evil-surround
|
2018-06-15 01:32:07 +00:00
|
|
|
:defer t
|
2016-05-14 15:45:07 +00:00
|
|
|
:init
|
2018-07-12 08:51:21 +00:00
|
|
|
(progn
|
2019-02-11 14:06:36 +00:00
|
|
|
;; `s' for surround instead of `substitute'
|
|
|
|
;; see motivation here:
|
|
|
|
;; https://github.com/syl20bnr/spacemacs/blob/develop/doc/DOCUMENTATION.org#the-vim-surround-case
|
|
|
|
(evil-define-key 'visual evil-surround-mode-map "s" 'evil-surround-region)
|
|
|
|
(evil-define-key 'visual evil-surround-mode-map "S" 'evil-substitute)
|
2018-07-12 08:51:21 +00:00
|
|
|
(spacemacs|add-transient-hook evil-visual-state-entry-hook
|
|
|
|
(lambda () (require 'evil-surround))
|
|
|
|
lazy-load-evil-surround)
|
|
|
|
(spacemacs|add-transient-hook evil-operator-state-entry-hook
|
|
|
|
(lambda () (require 'evil-surround))
|
|
|
|
lazy-load-evil-surround-2))
|
2018-06-15 01:32:07 +00:00
|
|
|
:config
|
2016-05-14 15:45:07 +00:00
|
|
|
(progn
|
2018-06-15 01:32:07 +00:00
|
|
|
(global-evil-surround-mode 1))))
|
2016-05-14 15:45:07 +00:00
|
|
|
|
2016-01-30 18:53:20 +00:00
|
|
|
(defun spacemacs-evil/init-evil-terminal-cursor-changer ()
|
|
|
|
(use-package evil-terminal-cursor-changer
|
|
|
|
:if (not (display-graphic-p))
|
|
|
|
:init (setq evil-visual-state-cursor 'box
|
|
|
|
evil-insert-state-cursor 'bar
|
|
|
|
evil-emacs-state-cursor 'hbar)))
|
|
|
|
|
2019-04-07 13:34:02 +00:00
|
|
|
(defun spacemacs-evil/init-evil-textobj-line ()
|
|
|
|
;; No laziness here, the line text object should be available right away.
|
|
|
|
(use-package evil-textobj-line))
|
|
|
|
|
2016-01-30 18:53:20 +00:00
|
|
|
(defun spacemacs-evil/init-evil-tutor ()
|
|
|
|
(use-package evil-tutor
|
|
|
|
:commands (evil-tutor-start
|
|
|
|
evil-tutor-resume)
|
|
|
|
:init
|
|
|
|
(progn
|
|
|
|
(setq evil-tutor-working-directory
|
|
|
|
(concat spacemacs-cache-directory ".tutor/"))
|
|
|
|
(spacemacs/set-leader-keys "hT" 'evil-tutor-start))))
|
|
|
|
|
|
|
|
(defun spacemacs-evil/init-evil-unimpaired ()
|
2016-07-06 11:11:45 +00:00
|
|
|
;; No laziness here, unimpaired bindings should be available right away.
|
2018-03-04 04:37:53 +00:00
|
|
|
(use-package evil-unimpaired))
|
2016-01-30 18:53:20 +00:00
|
|
|
|
2016-04-11 11:11:37 +00:00
|
|
|
(defun spacemacs-evil/init-evil-visual-mark-mode ()
|
|
|
|
(use-package evil-visual-mark-mode
|
2018-03-04 04:37:53 +00:00
|
|
|
:defer t
|
2016-04-11 11:11:37 +00:00
|
|
|
:init
|
|
|
|
(spacemacs|add-toggle evil-visual-mark-mode
|
2016-05-31 13:11:00 +00:00
|
|
|
:mode evil-visual-mark-mode
|
2016-04-11 11:11:37 +00:00
|
|
|
:documentation "Enable evil visual marks mode."
|
|
|
|
:evil-leader "t`")))
|
2016-05-14 15:45:07 +00:00
|
|
|
|
2018-03-05 01:36:40 +00:00
|
|
|
(defun spacemacs-evil/init-evil-visualstar ()
|
|
|
|
(use-package evil-visualstar
|
|
|
|
:commands (evil-visualstar/begin-search-forward
|
|
|
|
evil-visualstar/begin-search-backward)
|
|
|
|
:init
|
|
|
|
(progn
|
|
|
|
(define-key evil-visual-state-map (kbd "*")
|
|
|
|
'evil-visualstar/begin-search-forward)
|
|
|
|
(define-key evil-visual-state-map (kbd "#")
|
|
|
|
'evil-visualstar/begin-search-backward))))
|
|
|
|
|
2016-05-14 15:45:07 +00:00
|
|
|
(defun spacemacs-evil/init-hs-minor-mode ()
|
2016-05-17 01:01:41 +00:00
|
|
|
(add-hook 'prog-mode-hook 'spacemacs//enable-hs-minor-mode))
|
2016-05-14 15:45:07 +00:00
|
|
|
|
2016-05-21 03:57:32 +00:00
|
|
|
(defun spacemacs-evil/init-linum-relative ()
|
|
|
|
(use-package linum-relative
|
|
|
|
:commands (linum-relative-toggle linum-relative-on)
|
2016-05-17 04:05:14 +00:00
|
|
|
:init
|
|
|
|
(progn
|
2018-05-10 17:10:31 +00:00
|
|
|
(when (spacemacs/relative-line-numbers-p)
|
2016-11-04 18:33:40 +00:00
|
|
|
(add-hook 'spacemacs-post-user-config-hook 'linum-relative-on))
|
2016-10-11 23:54:37 +00:00
|
|
|
(spacemacs/set-leader-keys "tr" 'spacemacs/linum-relative-toggle))
|
2016-05-21 03:57:32 +00:00
|
|
|
:config
|
2016-11-04 18:33:40 +00:00
|
|
|
(setq linum-relative-current-symbol "")))
|
2016-05-17 04:05:14 +00:00
|
|
|
|
2016-05-14 15:45:07 +00:00
|
|
|
(defun spacemacs-evil/init-vi-tilde-fringe ()
|
|
|
|
(spacemacs|do-after-display-system-init
|
|
|
|
(use-package vi-tilde-fringe
|
|
|
|
:init
|
|
|
|
(progn
|
|
|
|
(global-vi-tilde-fringe-mode)
|
|
|
|
(spacemacs|add-toggle vi-tilde-fringe
|
2016-05-31 13:11:00 +00:00
|
|
|
:mode global-vi-tilde-fringe-mode
|
2016-05-14 15:45:07 +00:00
|
|
|
:documentation
|
|
|
|
"Globally display a ~ on empty lines in the fringe."
|
|
|
|
:evil-leader "T~")
|
2016-06-13 04:39:08 +00:00
|
|
|
;; don't enable it on some special buffers
|
2017-08-28 09:13:59 +00:00
|
|
|
(with-current-buffer spacemacs-buffer-name
|
|
|
|
(spacemacs/disable-vi-tilde-fringe))
|
2016-06-18 04:19:59 +00:00
|
|
|
(add-hook 'which-key-init-buffer-hook 'spacemacs/disable-vi-tilde-fringe)
|
2016-05-14 15:45:07 +00:00
|
|
|
;; after a major mode is loaded, check if the buffer is read only
|
|
|
|
;; if so, disable vi-tilde-fringe-mode
|
|
|
|
(add-hook 'after-change-major-mode-hook
|
|
|
|
'spacemacs/disable-vi-tilde-fringe-read-only)
|
|
|
|
;; TODO move this hook if/when we have a layer for eww
|
|
|
|
(spacemacs/add-to-hooks 'spacemacs/disable-vi-tilde-fringe
|
|
|
|
'(eww-mode-hook)))
|
|
|
|
:config
|
|
|
|
(spacemacs|hide-lighter vi-tilde-fringe-mode))))
|