【问题标题】:How to open sublime text 3 from console with the current folders as project? [duplicate]如何使用当前文件夹作为项目从控制台打开 sublime text 3? [复制]
【发布时间】:2016-06-17 18:25:35
【问题描述】:

我想从控制台打开带有项目的 sublime text 3。该项目是我输入'subl' 的当前文件夹。例如:

cd ./project/test-1

pwd

subl .

我在控制台输入subl后,打开sublime text 3,打开./project/test-1作为当前项目。我知道在 4:50 here 是可能的。怎么样?

【问题讨论】:

  • 我不明白你的问题 - 你到底想做什么? subl . 将使用侧边栏中的当前文件夹打开 Sublime。这不是你想要的吗?
  • 是的,没错!抱歉,我知道我的问题需要改进。
  • 这不是问题需要改进 - 没有问题。

标签: shell sublimetext2 sublimetext


【解决方案1】:

将完整路径作为参数传递给-a

subl -a "$PWD"
# or
subl -a $(pwd)

确保您的 sublime 版本支持 -a 选项:

subl --help


Arguments:
  --project <project>: Load the given project
  --command <command>: Run the given command
  -n or --new-window:  Open a new window
  -a or --add:         Add folders to the current window
  -w or --wait:        Wait for the files to be closed before returning
  -b or --background:  Don't activate the application
  -h or --help:        Show help (this message) and exit
  -v or --version:     Show version and exit

Filenames may be given a :line or :line:column suffix to open at a specific
location.

【讨论】:

  • "subl" 结果 "zsh: command not found: subl"。我需要建立一个链接(ln)将崇高文本链接到“subl”吗?我在网上阅读了很多教程,但没有这样做。
  • 你说:“我在控制台输入subl 后,sublime text 3 是打开的……”。所以我以为你设置了别名subl=sublime
猜你喜欢
  • 1970-01-01
  • 2017-03-23
  • 2016-07-12
  • 1970-01-01
  • 2023-03-06
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2013-09-18
相关资源
最近更新 更多