使用新文件名保存文件:附加到现有文件名 [英] Save file with new filename: append to existing filename

查看:47
本文介绍了使用新文件名保存文件:附加到现有文件名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有一种简单的方法来(在 VIM 中)使用当前打开的文件的当前名称加上附加的短语来保存当前打开的文件?

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

IE,从 /home/affert/ 输入 vim/data/folder/file1.txt

然后将文件另存为/data/folder/file1.txt_BACKUP,无需复制粘贴文件名?

then save the file as /data/folder/file1.txt_BACKUP without needing to copy and paste the filename?

上下文:我有一个文件,其中包含指向其他文件夹中其他文件的完整路径.我使用 ctrl+W, ctrl+F 在新窗口中打开文件.这就是为什么我不想复制和粘贴.顺便说一句,文件夹和文件名要长得多,所以自己输入它们不是一个有用的选择.

Context: I have a file that has full paths in it to other files in other folders. I use ctrl+W, ctrl+F to open the file in a new window. That's why I don't want to copy and paste. BTW, the folder and file names are a lot longer, so typing them myself is not a useful option.

推荐答案

:w %:p_BACKUP

有关说明,请参阅如何展开完整路径要传递给 Vim 中的命令的当前文件?.

这篇关于使用新文件名保存文件:附加到现有文件名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆