How to set emacs to open new files in current instance on Ubuntu/Mint?

后端 未结 3 525
面向向阳花
面向向阳花 2021-01-31 20:27

I want to keep emacs open most of the time, and then whenever I open a text file, python file, etc (from nautilus/finder), I want it to open as a new buffer in my current emacs

相关标签:
3条回答
  • 2021-01-31 20:59

    You want emacs client.

    Basically, set emacsclient as your default editor, and add (server-start) somewere in your emacs config.

    There needs to be a running Emacs instance for emacsclient to work, but if it's a hassle it's possible to have a headless Emacs launched at login.

    0 讨论(0)
  • 2021-01-31 20:59

    Just for your information, If you are using GUI version on Mac, the dir os emacsclient is below:

    /Applications/Emacs.app/Contents/MacOS/bin/emacsclient
    
    0 讨论(0)
  • 2021-01-31 21:10

    Did you start server in emacs? Make sure that you add (server-start) to your .emacs or do M-x server-start from an existing EMACS session.

    Conceptually, it's really easy, just do emacsclient file-name on the command line or where you name the program.

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