ergoemacs / ergoemacs-mode

ergoemacs-mode
ergoemacs.github.io/
GNU General Public License v3.0
293 stars 35 forks source link

Ergoemacs loading ~5 seconds. #426

Closed brs-dev closed 8 years ago

brs-dev commented 8 years ago

Hi! Why ergoemacs have a load 5 seconds? But if i'm try use evil-mode load instant.

mattfidler commented 8 years ago

Good question.

evil-mode sets up a keymap immediately; it does not look up keybindings based on all the keymaps installed in emacs.

In the first start-up, ergoemacs-mode does the following:

This should only occur once per emacs platform/version run.

The next thing that ergoemacs-mode does is:

The last think is trying to lookup keys to ensure maximum compatability. This is done by:

This will usually allow the right actions, and maximum compatibility with emacs packages. For example, the save key will behave correctly in org-agenda-mode even though the commands are different. This is because both org-agenda-mode and default emacs define the key Ctrl+X Ctrl+S for the emacs save.

Sometimes, depending on your setup, some of these things are cached, and will take less time on startup. Unfortunately, I haven't figured out how to cache these so that the keys run almost instantaneously. You can submit a pull request if you have something that works instantly.

If you ever want to check what is slowing ergoemacs-mode, you can always issue the command Alt+a ergoemacs-timing-results to see where ergoemacs-mode is slowing down.

brs-dev commented 8 years ago

Thank you for response