Zsh别名以启动Sublime Text并打开当前目录

问题描述 投票:0回答:1

我正在使用zsh并尝试创建一个快捷方式stt,所以我可以在崇高的文本中打开一个文件夹。我目前添加了一个我在网站上找到的别名,但它只打开一个空白的sublime,没有我文件夹中的文件。我不确定我需要添加什么。谢谢。

alias stt="/Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl"
zsh sublimetext zsh-alias
1个回答
0
投票

来自subl的文档:

subl --help
Sublime Text 2 Build 2221                                                                                                                                                                                                                     

Usage: sublime_text [arguments] [files]         edit the given files
   or: sublime_text [arguments] [directories]   open the given directories

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.

要使stt别名打开一个打开当前工作目录的新窗口:

alias stt='/Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl -n -a .'
© www.soinside.com 2019 - 2024. All rights reserved.