Mac*_*och 107 sublimetext sublimetext3
我不经常使用ST控制台(我只使用它一次来安装软件包管理器),但我想这可能是一个很好的方法:
有谁知道获取当前文件路径的简单方法?
Rai*_*ide 208
右键单击文件中的某个位置(不在标题选项卡上) - >复制文件路径
如果您不想使用鼠标,可以按照此处的说明设置键盘快捷键https://superuser.com/questions/636057/how-to-set-shortcut-for-copy-file-path-in -sublime文本-3
che*_*pus 21
要轻松复制当前文件路径,请将以下内容添加到Key Bindings - User:
{ "keys": ["ctrl+alt+c"], "command": "copy_path" },
Run Code Online (Sandbox Code Playgroud)
Key Bindings - User可以通过命令面板打开(command + p在OSX上)
小智 10
使用图像易于理解.在右键单击,你会得到这个.
为方便起见,在图像中转录代码:
import sublime, sublime_plugin, os
class CopyFilenameCommand(sublime_plugin.TextCommand):
def run(self, edit):
if len(self.view.file_name()) > 0:
filename = os.path.split(self.view.file_name())[1]
sublime.set_clipboard(filename)
sublime.status_message("Copied file name: %s" % filename)
def is_enabled(self):
return self.view.file_name()... # can't see
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
39824 次 |
| 最近记录: |