ahyatt / ekg

The emacs knowledge graph, app for notes and structured data.
GNU General Public License v3.0
224 stars 18 forks source link

need hook to disable evil mode in ekg-notes-mode #125

Closed vigilancetech-com closed 9 months ago

vigilancetech-com commented 9 months ago

I'm in doom emacs and it tries to apply evil everywhere so when I bring up the notes view mode many/most of the key bindings are shadowed but I can't find any hook when entering that mode (after the buffer is created) to turn evil off.

ahyatt commented 9 months ago

I believe ekg-notes-mode-hook is what you are looking for. Does that work for you?

vigilancetech-com commented 9 months ago

I believe ekg-notes-mode-hook is what you are looking for. Does that work for you?

strangely no.

I set this up:

(add-hook 'ekg-notes-mode-hook (lambda () (message "turning off evil mode in ekg-notes-mode") (turn-off-evil-mode)))

and even tho I see the message show up when I display notes evil mode is still enabled!

If I M-x turn-off-evil-mode then it does in fact turn off. What am I missing?

qingshuizheng commented 9 months ago

According to https://evil.readthedocs.io/en/latest/settings.html#elispobj-evil-default-state , you could set its initial state in ekg-notes-mode as emacs (not sure).

(evil-set-initial-state 'ekg-notes-mode 'emacs)

Note: I don't use either doom or evil, cannot confirm that though.

vigilancetech-com commented 9 months ago
(evil-set-initial-state 'ekg-notes-mode 'emacs)

that seems to have worked.

Quick question:

When I'm in a non-notes buffer, what command am I supposed to use to pull up a list of notes? All the ones I've tried other than ekg-capture say I already have to be in ekg-notes mode before I can execute them.

qingshuizheng commented 9 months ago

what command am I supposed to use to pull up a list of notes?

The most frequently used command for me: ekg-show-notes-with-all-tags ekg-show-notes-latest-modified ekg-show-notes-latest-created

For the full list, please refer to the README.org: https://github.com/ahyatt/ekg#command-summary

ahyatt commented 9 months ago

Thank you for your help @qingshuizheng! I'm going to close this, as the issue was resolved. Perhaps this deserves a note in the manual, though.