You will need to unmap
D only for the filetype
netrw to do that you can create the file
~/.vim/after/ftplugin/netrw.vim and inside put the following lines:
" Avoid unwanted file deletions with D
unmap <buffer> D
Then you should be good to go,
D will not do the suppression anymore.
How does it work?
:h ftplugin, the idea is to create a file which will be sourced when the filetype of a buffer is set to
netrw but after the Netrw plugin did it's own configurations so that you can override them. Note that instead you can probably use an autocommand, but I think it would be pretty redundant since that would be not using the built-in Vim mechanisms.
<buffer> parameter to the
unmap command is necessary because Netrw remaps
D only in its own buffers.