How can I delete the current file in vim?

后端 未结 6 1972
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-30 01:35

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

6条回答
  •  渐次进展
    2021-01-30 02:04

    You can do it with two steps:

    1. save as a new file

      :w newfilename

    2. delete the old file

      ! rm oldfilename

提交回复
热议问题