在崇高文本3

时间:2017-10-25 11:41:58

标签: sublimetext3

我在Sublime text3中安装了终端包。 我想做的是打开一个文件的终端。 也就是说,如果我的项目根目录是src,位于我的主目录的[some directories]下,并且有很多子目录。

~/[some directories]/src/是我崇高的项目根

有一个java代码的路径: ~/[some directories]/src/dir1/dir2/dir3/Test.java

我想要做的是,如果我点击command + shift + t,它会打开~/[some directories]/src/dir1/dir2/dir3/的终端,以便我可以在此目录上工作。

但如果我点击command + shift + t,则终端路径是当前项目根目录(~/[some directories]/src),因此我需要在终端中键入cd dir1/dir2/dir3/。这很烦人。

终端包的当前键绑定是

默认(OSX).sublime-keymap - 终端(默认的键绑定):

[
   { "keys": ["Command+Option+Shift+t"], "command": "open_terminal" },
   { "keys": ["Command+Shift+t"], "command": "open_terminal_project_folder" },
] 

默认(OSX).sublime-keymap - 用户(用户的键绑定):为空

我调整了这个和那个并用谷歌搜索它但找不到正确的键绑定。

1 个答案:

答案 0 :(得分:0)

如果您转到'首选项 - >套餐 - >终端 - >设置 - 用户' 您可以为您启动的终端指定参数。

在带有cmder终端的窗口上,我有:

{
    // The command to execute for the terminal, leave blank for the OS default
    // On OS X the terminal can be set to iTerm.sh to execute iTerm
    "terminal": "C:\\morten\\bin\\cmder\\Cmder.exe",

    // A list of default parameters to pass to the terminal, this can be
    // overridden by passing the "parameters" key with a list value to the args
    // dict when calling the "open_terminal" or "open_terminal_project_folder"
    // commands
    "parameters": ["/START", "%CWD%"]
}

应该可以轻松调整到您的操作系统/终端。

当运行open_terminal( ctrl + shift + t )时,这将始终在您当前正在查看的文件的目录中启动cmder

相关问题