ahyatt / ekg

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

[CONFIG] evil setup #160

Closed oatmealm closed 3 months ago

oatmealm commented 4 months ago

I have evil enabled (in doom) and set ekg up this way :

(set-evil-initial-state! 'ekg-notes-mode 'normal) ; that's the default in anycase 
  (evil-define-key 'normal ekg-notes-mode-map
    "A" 'ekg-notes-any-tags
    "B" 'ekg-notes-select-and-browse-url
    "a" 'ekg-notes-any-note-tags
    "b" 'ekg-notes-browse
    "c" 'ekg-notes-create
    "d" 'ekg-notes-delete
    "g" 'ekg-notes-refresh
    "k" 'ekg-notes-kill
    "n" 'ekg-notes-next ;; or "j"
    "o" 'ekg-notes-open
    "p" 'ekg-notes-previous ;; or "k"
    "q" 'kill-buffer-and-window
    "t" 'ekg-notes-tag)

I use kill-buffer-and-window to kill also the window, which otherwise hangs around. It happens with othe ekg window/buffers btw, which is messy from a UI point of view for me at least.

ahyatt commented 4 months ago

i see, so the bug is that we should also kill the window? Is the thinking that since we created the window we should also kill it? I think that makes sense - maybe we should change this keybinding. Or maybe we should just not create a window when running ekg commands. I can't recall why I decided to do that, but will think about the best solution here. Thanks for pointing this out!

oatmealm commented 4 months ago

Yes it's a good question. I guess creating a window makes sense, but if created, killing the buffer this way seems messy to me.

I'm pretty sure I would love it if opening a note from ekg-notes, for example, would split the window vertically and when I'm done (C-c...) will kill the buffer and window. In a workflow where you open multiple notes, you'd then should probably consider creating another window, rather than reusing the first window, assuming you want all the notes fully visible... etc.

In either case closing the window when done makes sense to me, unless ekg opened the note in a window already showing another buffer I was working in.

I don't have a preferred workflow for ekg yet, so I think more input from users would help.

ahyatt commented 3 months ago

I've merged in a change that will stop splitting the window to show notes - it will just open it up in the current window. This seems like the right thing to do, AFAICT. For example, M-x info works like this. That should solve this issue, but perhaps after using it like this, I may have second thoughts and I'll try the other way. Let's see!