美文网首页
Mac中用命令行让sublime 3打开文件或者目录

Mac中用命令行让sublime 3打开文件或者目录

作者: 木猫尾巴 | 来源:发表于2016-08-21 12:05 被阅读737次

说明

sublime text 官方说这样可以,其实不适用
https://www.sublimetext.com/docs/3/osx_command_line.html

使用原生bash

alias subl=\''/Applications/Sublime Text 3.app/Contents/SharedSupport/bin/subl'\'

使用 zsh

在文件 ~/.zshrc 最后添加

alias subl="'/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl'"
alias nano="subl"
export EDITOR="subl"

再执行

source ~/.zshrc

# 使用

```sh
# 任意目录或者文件
subl [fileOrFolder]

相关文章

网友评论

      本文标题:Mac中用命令行让sublime 3打开文件或者目录

      本文链接:https://www.haomeiwen.com/subject/estwsttx.html