jmorag / kakoune.el

A very simple simulation of the kakoune editor inside of emacs.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Not starting on new buffers

opened this issue · comments

Hi,

I'm not sure if I'm missing something somewhere but I can't get kakoune.el to start in the "normal" mode on new buffers. It works perfectly fine to use something like (global-set-key (kbd "<escape>") 'ryo-enter) to get into that mode and then kakoune-insert-mode) to get back out of it but I am forced to press escape (or the default control + z) every time. I tried doing something like:

(defun ryo-default ()
   'ryo-enter
)

(add-hook 'buffer-list-update-hook 'ryo-default)

but that didn't appear to do anything.

I'm still pretty new to emacs (and kakoune for that matter 😄) so it's more than likely that I am just not understanding something pretty normal but I'd greately appreciate some help :)

Thanks!

I wouldn't recommend starting every buffer in normal mode, since modes like magit and help have their own keybindings. For modes where you are actually editing text, you want (add-hook 'prog-mode-hook #'ryo-modal-mode) and (add-hook 'text-mode-hook #'ryo-modal-mode). If you want to get more fine-grained with which modes you want this to run in, you could also do

(dolist (hook '(python-mode-hook emacs-lisp-mode-hook ...))
    (add-hook hook #'ryo-modal-mode))

Hope this helps!

Thank you so much! That works absolutely beautifully!