如何扩展当前文件的完整路径以传递给 Vim 中的命令? [英] How can I expand the full path of the current file to pass to a command in Vim?

查看:15
本文介绍了如何扩展当前文件的完整路径以传递给 Vim 中的命令?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我进入命令模式并输入

When I go to command mode and type

:!mycommand %

我在当前文件上执行我的命令(% 被扩展为当前文件名).是否有类似的结构可以扩展完整文件名(带有完整路径)?

I get my command executed on the current file (% is expanded to the current file name). Is there a similar construct that expands the full file name (with the full path)?

我使用的是 Windows.

I am using Windows.

推荐答案

:!mycommand %:p

相关:

:!cd %:p:h

这篇关于如何扩展当前文件的完整路径以传递给 Vim 中的命令?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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