noctuid / general.el

More convenient key definitions in emacs
GNU General Public License v3.0
1k stars 44 forks source link

Use of backtab and set tab to fold in insert mode #483

Closed shadowrylander closed 3 years ago

shadowrylander commented 3 years ago

Hello!

I have two small questions:

  1. How do I define a backtab with general.el? At the moment, to override the key, I'm using the following:
    (define-key evil-normal-state-map (kbd "<backtab>") 'jr/evil-close-fold)
  2. How can I override the org-mode indentation function of TAB in evil-insert-state-map? I'd like it to always fold and unfold the current or parent header, and switch the indentation functionality to another keybinding.

Thank you kindly for the help!

noctuid commented 3 years ago

Sorry for the late response. If you still want to know:

(general-def 'normal "<backtab>" #'jr/evil-close-fold)

(general-def 'insert org-mode-map "<tab>" #'your-chosen-fold-command)
shadowrylander commented 3 years ago

No problem, and thanks for the help! I've switched away from primarily using evil, but if I come back, I'll use this bit!