vim:keys: Add <leader>dd to clear line

I sometimes have the situation that I want to create empty lines but
they contain either whitespace from keeping the indentation and/or the
comment string (`o` on a comment line). My current workflow is to either
delete it and recreate it properly (e.g. from the 'other side' i.e. a
non-comment line) or clear it with `cc`. Both ways are a bit awkward.

Add a mapping that clears a line but stays in normal mode.

Also remove the `<leader>d` mapping that deletes and puts the content
into the system clipboard as I rarely use this one.
This commit is contained in:
2022-08-30 14:57:52 +02:00
parent c0892a8bdb
commit 6f0b433fdf

View File

@@ -28,7 +28,6 @@ endif
if (has('clipboard'))
map <leader>y "+y
map <leader>Y "+Y
map <leader>d "+d
map <leader>p "+p
map <leader>P "+P
endif
@@ -149,6 +148,9 @@ endif
" Y should behave like D & C does
nnoremap Y y$
" Clear line (`cc` but stay in normal mode)
nmap <leader>dd ^D
" Move lines up and down while correcting the indentation
" https://vim.fandom.com/wiki/Moving_lines_up_or_down
" (Use arrows, as Alt-{j,k} is used by my terminal for scrollback)