Save file with new filename: append to existing filename

前端 未结 2 1143
甜味超标
甜味超标 2021-02-01 13:47

Is there a simple way to (in VIM) do save the currently open file with it\'s current name plus an appended phrase?

IE, from /home/affert/ type vim /

相关标签:
2条回答
  • 2021-02-01 14:08
    :w %:p_BACKUP
    

    For explanation see How can I expand the full path of the current file to pass to a command in Vim?.

    0 讨论(0)
  • 2021-02-01 14:12

    Easy:

     :w %_BACKUP
    

    If you need override:

     :w %_BACKUP!
    

    The it gonna answer:

    "filename_BACKUP!" [New] XL, XC written 
    
    0 讨论(0)
提交回复
热议问题