How can I delete from the disk the current open file from within vim? Would be nice to also close the buffer.
I see you can use NERDTree for that, but I don\'t use this
Using an external tool such as rm(1) is fine, but Vim also has its own delete() function for deleting files. This has the advantage of being portable.
:call delete(expand('%'))
An alternative way of expressing this is :call delete(@%), which uses the % (current file) register (tip by @accolade).
To completely purge the current buffer, both the file representation on disk and the Vim buffer, append :bdelete:
:call delete(expand('%')) | bdelete!
You'll probably want to map this according to your preferences.