A few months ago I read Drew Neil's article about split windows and the project drawer. It's a great article and I strongly recommend you to go ahead and read it.
The article got me spending some time with netrw and sure enough, it replaced NERDTree. One thing that annoyed me though, was its default for deleting directories. Quoting from :help netrw-delete
.
Deleting/removing files and directories involves moving the cursor to the file/directory to be deleted and pressing "D". Directories must be empty first before they can be successfully removed.
This is not a default I'm happy with, but as with everything else in Vim, netrw is customisable. The default command for deleting local directories is rmdir
which requires the directory to be empty. By setting g:netrw_localrmdir
to something else, such as rm -r
I get the behavior I want.
Excerpt from my .vimrc:
" Allow netrw to remove non-empty local directories
"
let g:netrw_localrmdir='rm -r'
Happy Hacking!
GitHub: KevinSjoberg | Twitter: KevinSjoberg
Thanks for the tip!
With this, you're free to change the
rm
command to anything you want. Right now I disabled therm
command on my machine with alias and switched to usetrash
instead to move everything to trash.