The kind of directory you are accessing is called netrw . You can read all of your documentation with :help netrw , but what you are looking for in this case is available :help netrw-delete :
The variable g: netrw_rmdir_cmd is used to support directory deletion. Its default value is:
g: netrw_rmdir_cmd: ssh HOSTNAME rmdir
If directory deletion fails with g: netrw_rmdir_cmd, netrw will then try to delete it again using the g: netrw_rmf_cmd variable. Its default value is:
g: netrw_rmf_cmd: ssh HOSTNAME rm -f
So, you can redefine the variable containing the command to remove such a directory:
let g:netrw_rmf_cmd = 'ssh HOSTNAME rm -rf'
EDIT . As stated above, this is quite risky. If you need additional confirmation, if the directory is not empty, you can write a shell script that invokes the request. A quick google raised this SO question: bash user input if .
So you can write a script that would look like this:
#! /bin/bash hostname = $1 dirname = $2
Then set the command to execute the script
let g:netrw_rmf_cmd = 'safe-delete HOSTNAME'
Of course, a lot of rigorous testing is recommended :).
source share