From 010ccc8284634588a857ca7f34ef99527901879e Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Mon, 27 Jan 2020 08:38:25 +0100 Subject: [PATCH] Add true delete shortcut to vim Mimicks vifm d for grabbing and cutting, D for true deletion. Works well to delete a line (e.g. left-over empty) while still keeping last selection in yank-register. Starts a d-motion, so it can be used with all motions. --- nvim/.config/nvim/maps.vim | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/nvim/.config/nvim/maps.vim b/nvim/.config/nvim/maps.vim index 5d9da2d..44bec09 100644 --- a/nvim/.config/nvim/maps.vim +++ b/nvim/.config/nvim/maps.vim @@ -15,6 +15,11 @@ nnoremap " since u undoes, would it not make sense that U redoes? nnoremap U +" d-motion puts the last 'deleted' thing into the default register to paste; +" use D-motion to truly delete something into nothingness and keep whatever +" you want in your register, ready to paste +nnoremap D "_d + " I don't particularly need ex mode (at least, yet) but faster macro access " is nice nnoremap Q @