Replace doom/backward-kill-to-bol-and-indent
WIth new evil-delete-back-to-indentation, with behaves exactly as C-u does in vim.
This commit is contained in:
parent
a49c0b6691
commit
c1879945fd
6 changed files with 7 additions and 21 deletions
|
@ -155,20 +155,6 @@ true end of the line. The opposite of `doom/backward-to-bol-or-indent'."
|
|||
tab-width
|
||||
(- tab-width movement)))))))))
|
||||
|
||||
;;;###autoload
|
||||
(defun doom/backward-kill-to-bol-and-indent ()
|
||||
"Kill line to the first non-blank character. If invoked again
|
||||
afterwards, kill line to beginning of line."
|
||||
(interactive)
|
||||
(let ((empty-line-p (save-excursion (beginning-of-line)
|
||||
(looking-at-p "[ \t]*$"))))
|
||||
(funcall (if (fboundp 'evil-delete)
|
||||
#'evil-delete
|
||||
#'delete-region)
|
||||
(point-at-bol) (point))
|
||||
(unless empty-line-p
|
||||
(indent-according-to-mode))))
|
||||
|
||||
;;;###autoload
|
||||
(defun doom/retab (arg &optional beg end)
|
||||
"Converts tabs-to-spaces or spaces-to-tabs within BEG and END (defaults to
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
;;; config/default/+bindings.el -*- lexical-binding: t; -*-
|
||||
|
||||
(when (featurep! :editor evil +everywhere)
|
||||
;; Have C-u behave similarly to `doom/backward-to-bol-or-indent'.
|
||||
;; `evil' provides `C-u' (bound to `evil-delete-back-to-indentation')
|
||||
;; NOTE SPC u replaces C-u as the universal argument.
|
||||
(map! :i "C-u" #'doom/backward-kill-to-bol-and-indent
|
||||
:i "C-w" #'backward-kill-word
|
||||
(map! :i "C-w" #'backward-kill-word
|
||||
;; Vimmish ex motion keys
|
||||
:i "C-b" #'backward-word
|
||||
:i "C-f" #'forward-word)
|
||||
|
@ -23,7 +22,7 @@
|
|||
"C-b" #'backward-word
|
||||
"C-f" #'forward-word
|
||||
"C-r" #'evil-paste-from-register
|
||||
"C-u" #'doom/backward-kill-to-bol-and-indent
|
||||
"C-u" #'evil-delete-back-to-indentation
|
||||
"C-v" #'yank
|
||||
"C-w" #'backward-kill-word
|
||||
"C-z" (λ! (ignore-errors (call-interactively #'undo)))
|
||||
|
|
|
@ -262,7 +262,7 @@
|
|||
"s-/" (λ! (save-excursion (comment-line 1)))
|
||||
:n "s-/" #'evilnc-comment-or-uncomment-lines
|
||||
:v "s-/" #'evilnc-comment-operator
|
||||
:gi [s-backspace] #'doom/backward-kill-to-bol-and-indent
|
||||
:gi [s-backspace] #'evil-delete-back-to-indentation
|
||||
:gi [s-left] #'doom/backward-to-bol-or-indent
|
||||
:gi [s-right] #'doom/forward-to-last-non-comment-or-eol
|
||||
:gi [M-backspace] #'backward-kill-word
|
||||
|
|
|
@ -22,6 +22,7 @@ directives. By default, this only recognizes C directives.")
|
|||
;; to loading.
|
||||
(defvar evil-want-C-i-jump (or (daemonp) (display-graphic-p)))
|
||||
(defvar evil-want-C-u-scroll t)
|
||||
(defvar evil-want-C-u-delete t)
|
||||
(defvar evil-want-C-w-scroll t)
|
||||
(defvar evil-want-Y-yank-to-eol t)
|
||||
(defvar evil-want-abbrev-expand-on-insert-exit nil)
|
||||
|
|
|
@ -67,7 +67,7 @@
|
|||
(company-complete-common . evil-mc-execute-default-complete)
|
||||
(doom/backward-to-bol-or-indent . evil-mc-execute-default-call)
|
||||
(doom/forward-to-last-non-comment-or-eol . evil-mc-execute-default-call)
|
||||
(doom/backward-kill-to-bol-and-indent . evil-mc-execute-default-call)
|
||||
(evil-delete-back-to-indentation . evil-mc-execute-default-call)
|
||||
;; Have evil-mc work with explicit `evil-escape' (on C-g)
|
||||
(evil-escape . evil-mc-execute-default-evil-normal-state)
|
||||
;; Add `evil-org' support
|
||||
|
|
|
@ -149,7 +149,7 @@ You should use `set-eshell-alias!' to change this.")
|
|||
[remap split-window-below] #'+eshell/split-below
|
||||
[remap split-window-right] #'+eshell/split-right
|
||||
[remap doom/backward-to-bol-or-indent] #'eshell-bol
|
||||
[remap doom/backward-kill-to-bol-and-indent] #'eshell-kill-input
|
||||
[remap evil-delete-back-to-indentation] #'eshell-kill-input
|
||||
[remap evil-window-split] #'+eshell/split-below
|
||||
[remap evil-window-vsplit] #'+eshell/split-right)))
|
||||
(add-hook! 'eshell-mode-hook
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue