Skip to content

Instantly share code, notes, and snippets.

@mortymacs
Last active February 18, 2020 19:33
Show Gist options
  • Save mortymacs/e86aea46f87abde0636982333d03c66a to your computer and use it in GitHub Desktop.
Save mortymacs/e86aea46f87abde0636982333d03c66a to your computer and use it in GitHub Desktop.
Increase emacs startup speed

Add this line in /etc/profile:

if [ ! `ps -x | grep emacs | grep daemon | awk '{ print $2 }'` ]; then
  emacs --daemon 2> /dev/null
fi

Relogin again to start the daemon.

Now you can edit your files with emacsclient command like so:

$ emacsclient sample.cpp

If you want to run emacsclient in gui mode, run this command:

$ emacsclient -c sample.cpp

To make your default emacs application to run emacsclient instead of emacs command, edit your /usr/share/applications/emacs.desktop file and change Exec line to this:

Exec=emacsclient -c %F

If emacs.desktop has Try variable, change that too.

Note: if your emacsclient gui doens't load your theme or config, just load it via M-x+load-file+~/.emacs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment