How to open Atom editor from command line in OS X?

后端 未结 18 1838
天命终不由人
天命终不由人 2020-12-02 03:44

I have the Atom editor and was wondering how you can open a file or folder from the terminal in Atom. I am using a Mac. I am looking for a way to do this:

at         


        
相关标签:
18条回答
  • 2020-12-02 04:17

    I am on mingw bash, so I have created ~.profile file with following: alias atom='~/AppData/Local/atom/bin/atom'

    0 讨论(0)
  • 2020-12-02 04:18

    I had problems due to atom being unable to write its logfile when starting from the commandline. This cured it.

    sudo chmod 777 ~/.atom/nohup.out

    0 讨论(0)
  • 2020-12-02 04:22

    For Windows10 and new release of atom i solved the problem by adding in my ENV VARIABLE on the "PATH" row

    %USERPROFILE%\AppData\Local\atom\bin
    
    0 讨论(0)
  • 2020-12-02 04:22

    With conemu on windows 10 I couldn't call atom from console even after I added %USERPROFILE%\AppData\Local\atom\bin to PATH in environment variables. I just added

    alias atom="C:/Users/me/AppData/local/atom/app-1.12.7/atom"
    

    to my .bashrc file.

    0 讨论(0)
  • 2020-12-02 04:28

    The symlink solution for this stopped working for me in zsh today. I ended up creating an alias in my .zshrc file instead:

    alias atom='sh /Applications/Atom.app/Contents/Resources/app/atom.sh'

    0 讨论(0)
  • 2020-12-02 04:31

    Iv'e noticed this recently with all new macs here at my office. Atom will be installed via an image for the developers but we found the Atom is never in the Application folder.

    When doing a ls on the /usr/local/bin folder the path for atom will show something like "/private/var/folders/cs" . To resolve this, we just located atom.app and copied it into the application folder, then ran the system link commands provided by nwinkler which resoled the issue. Developers can now open atom from the command line with "atom" or open the current projects from their working director with "atom ."

    0 讨论(0)
提交回复
热议问题