【问题标题】:Zsh alias to launch Sublime Text with the current directory openedZsh 别名以在当前目录打开的情况下启动 Sublime Text
【发布时间】:2019-03-09 01:32:01
【问题描述】:

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

alias stt="/Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl"

【问题讨论】:

    标签: zsh sublimetext zsh-alias


    【解决方案1】:

    来自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 .'
    

    【讨论】:

      猜你喜欢
      • 2012-08-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多