我试图在 Sublime Text 2 的键绑定文件中获取当前文件的路径+文件名(不带扩展名)。$file_path
or ${file_path}
两者都不工作。
原因是我想执行一个 *.exe 文件,该文件是之前构建的(但不想一步构建和执行)。有任何想法吗?
Greetz
你可以尝试崇高片段 http://sublimetext.info/docs/en/extensibility/snippets.html,这是我的代码:
#filename: filename.sublime-snippet
<snippet>
<content><![CDATA[$TM_FILENAME]]></content>
<!-- Optional: Tab trigger to activate the snippet -->
<tabTrigger>fn</tabTrigger>
<!-- Optional: Scope the tab trigger will be active in -->
<scope>source.python</scope>
<!-- Optional: Description to show in the menu -->
<description>the current file name</description>
</snippet>
当你在 python 源文件中输入“fn”时,你将得到你的文件名。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)