You can use open -a typora xxx.md
to open the markdown file xxx.md
in Typora from a command line. If Typora is your default editor for .md
files, when open xxx.md
would be enough.
You can also add
alias typora="open -a typora"
in your .bash_profile
or other configuration file, then you would be able to simply type typora xxx.md
instead.
If you want to use command line to not only open existing files, but also creating new files when target .md
file does not exists, you could add
alias typora="/Applications/Typora.app/Contents/MacOS/Typora"
in your .bash_profile
or other configuration file.
Then if you run typora xxx.md
and xxx.md
does not exists, Typora will pop up a dialog to ask you whether to create target file or cancel the operation.
If Typora is set as the default markdown editor, then in cmd.exe, then typing .\example.md
or start example.md
will open this markdown file.
To set Typora as the default markdown editor:
Figure 1 - File properties window
Figure 2 - Application chooser window
You could also add typora.exe in PATH, then use typora xxx.md
to open markdown file, or create new one if target file does not exists.
After installing Typora on Linux, user can run typora
directly in terminal, for example:
typora ~/Document/test.md