shellvimterminalzshnano

How To Open A File Using Text Edit In Terminal in MacOS


Another small question. I just recently migrated to ZSH and, so far I am loving it! My question is how can I open a file using TextEdit so that I can edit it using a GUI? Make no mistake, Vim is an amazing command-line tool for editing files in the terminal along with nano.

Let's say that I wanted to open the .zshrc using vim :

vim ~/.zshrc

In the same way, open the .zshrc using nano:

nano ~/.zshrc

How can I open the same ~/.zshrc file using text edit through the terminal?

Thanks a lot and I really appreciate your help :)


Solution

  • Here is the solution, I know it's a bit tedious but, you can open the ~/.zshrc using this command :

    open -a TextEdit ~/.zshrc