且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在Sublime Text 2中的键绑定文件中获取文件路径和文件名

更新时间:2021-12-21 03:03:00

Sublime提供了一个名为copy_path的命令,该命令会将当前文件的绝对路径复制到剪贴板.不幸的是,这包括文件扩展名.但是,如果您熟悉如何滚动自己的快速插件,则可以在其中发布copy_path,并执行一些基本的字符串操作以去除文件扩展名.如果不是,您可以将copy_path绑定到组合键并从那里开始工作.

Sublime offers a command called copy_path which will copy the current file's absolute path to the clipboard. Unfortunately, this includes the file extension. But if you're familiar with how to roll your own quick plugin, you can issue copy_path therein, and perform some basic string manipulation to strip the file extension. If not though, you can bind copy_path to a key combination and work from there.