Enable delete-selection-mode & shift-select-mode

This makes text insertion behave more like traditional editors.

Delete-selection-mode allows selections to be replaced when yanking or
inserting. This enables it by default for non-evil users and in insert
mode for evil users. Also enables selecting text with shift.
This commit is contained in:
Henrik Lissner 2019-03-01 15:32:47 -05:00
parent 8903eebdc4
commit fb57f367e7
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
2 changed files with 7 additions and 2 deletions

View file

@ -27,6 +27,13 @@
epa-pinentry-mode 'loopback))
(if (not (featurep 'evil))
(delete-selection-mode +1)
(defun turn-off-delete-selection-mode () (delete-selection-mode -1))
(add-hook 'evil-insert-state-entry-hook #'delete-selection-mode)
(add-hook 'evil-insert-state-exit-hook #'turn-off-delete-selection-mode))
(when (featurep! +smartparens)
;; You can disable :unless predicates with (sp-pair "'" nil :unless nil)
;; And disable :post-handlers with (sp-pair "{" nil :post-handlers nil)

View file

@ -27,8 +27,6 @@ line with a linewise comment.")
evil-respect-visual-line-mode t
;; more vim-like behavior
evil-symbol-word-search t
;; don't activate mark on shift-click
shift-select-mode nil
;; cursor appearance
evil-default-cursor '+evil-default-cursor
evil-normal-state-cursor 'box