Set custom keybinding for specific Emacs mode

后端 未结 4 792
余生分开走
余生分开走 2021-01-30 03:15

Though I know how to set a global key-binding in Emacs, I find it hard to even Google out the code for a local (minor-mode specific) key-binding. For instance, I have this code

4条回答
  •  再見小時候
    2021-01-30 03:41

    To bind a key in a mode, you need to wait for the mode to be loaded before defining the key. One could require the mode, or use eval-after-load

       (eval-after-load 'latex 
                        '(define-key LaTeX-mode-map [(tab)] 'outline-cycle))
    

    Don't forget either 'eval-after-load is not a macro, so it needs them.

提交回复
热议问题