Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>The directory view you're referring to is called <code>netrw</code>. You could read up on its entire documentation with <code>:help netrw</code>, but what you're looking for in this case is accessible by <code>:help netrw-delete</code>:</p> <blockquote> <p>The g:netrw_rmdir_cmd variable is used to support the removal of directories. Its default value is:</p> <p>g:netrw_rmdir_cmd: ssh HOSTNAME rmdir</p> <p>If removing a directory fails with g:netrw_rmdir_cmd, netrw then will attempt to remove it again using the g:netrw_rmf_cmd variable. Its default value is:</p> <p>g:netrw_rmf_cmd: ssh HOSTNAME rm -f</p> </blockquote> <p>So, you could override the variable that contains the command to remove a directory like so:</p> <pre><code>let g:netrw_rmf_cmd = 'ssh HOSTNAME rm -rf' </code></pre> <p><strong>EDIT</strong>: Like sehe pointed out, this is fairly risky. If you need additional confirmation in case the directory is not empty, you could write a shell script that does the prompting. A quick google turned up this SO question: <a href="https://stackoverflow.com/questions/5542016/bash-user-input-if">bash user input if</a>.</p> <p>So, you could write a script that goes like this:</p> <pre><code>#! /bin/bash hostname = $1 dirname = $2 # ... # prompt the user, save the result # ... if $yes then ssh $hostname rm -rf $dirname fi </code></pre> <p>Then, set the command to execute your script</p> <pre><code>let g:netrw_rmf_cmd = 'safe-delete HOSTNAME' </code></pre> <p>A lot of careful testing is recommended, of course :).</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload