在Macintosh使用不同的編輯器開啟文字檔,例如說 ~/.bashrc,指令如下:
- open ~/.bashrc
- open -a "Visual Studio Code" ~/.bashrc
- open -a "Sublime Text" ~/.bashrc
上述指令的意思分別是:
- 用預設的文字編輯器 TextEditor 開啟文字檔案 ~/.bashrc
- 用 VSCode (Visual Studio Code) 開啟 ~/.bashrc
- 用 Sublime 開啟 ~/.bashrc
另外一種加速的方法則是放到~/.bashrc或~/.zshrc裡面:
- textedit='open -a TextEdit'
- vscode='open -a Visual\ Studio\ Code'
- sublime='open -a Sublime\ Text'
完成後重新登入,就可以用下列指令直接開啟檔案了:
- textedit /etc/hosts
- vscode ~/.bashrc
- sublime ~/.zshrc
參考資料
- Can I open files in TextEdit from the Terminal in Mac OS X?
裡面介紹到用alias這招蠻不錯的
_EOF_
Light Chinese painting style, white snow mountains in the background, rime-frozen river, nature, ultra-clear details, cold colors, master paintings
Steps: 20, Sampler: DPM++ 2M Karras, CFG scale: 7, Seed: 3924466691, Size: 512x256, Model hash: 6ce0161689, Model: v1-5-pruned-emaonly, Version: v1.6.0-2-g4afaaf8a
沒有留言:
張貼留言