From f58a81b200ccda0cbc0a7d1f8edbe30caa70d517 Mon Sep 17 00:00:00 2001 From: Zedhugh Chen Date: Thu, 27 Oct 2022 00:49:39 +0800 Subject: [PATCH] split which key config to init-which-key.el --- init.el | 7 ++----- lisp/init-which-key.el | 24 ++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 5 deletions(-) create mode 100644 lisp/init-which-key.el diff --git a/init.el b/init.el index 46be98f..3f86bb8 100644 --- a/init.el +++ b/init.el @@ -104,6 +104,7 @@ If freezing sometimes, decrease it. If stuttering, increase it.") (add-to-list 'load-path creature/pkg-dir t) (add-subdirs-to-load-path creature/pkg-dir) + (require 'init-built-in) (require 'init-git) (require 'init-edit) @@ -112,12 +113,8 @@ If freezing sometimes, decrease it. If stuttering, increase it.") (require 'init-keybindings) (require 'init-tools) (require 'init-ibuffer) +(require 'init-which-key) -(require 'which-key) -(setq which-key-show-early-on-C-h t) -(setq which-key-idle-delay 10000) -(setq which-key-idle-secondary-delay 0.05) -(which-key-mode 'toggle) (setq custom-file (expand-file-name "custom.el" creature/cache-dir)) (when (file-exists-p custom-file) diff --git a/lisp/init-which-key.el b/lisp/init-which-key.el new file mode 100644 index 0000000..e04e60f --- /dev/null +++ b/lisp/init-which-key.el @@ -0,0 +1,24 @@ +;; -*- coding: utf-8; lexical-binding: t; -*- + +(require 'which-key) +(setq which-key-show-early-on-C-h t) +(setq which-key-idle-delay 10000) +(setq which-key-idle-secondary-delay 0.05) +(which-key-mode 1) + +(which-key-add-keymap-based-replacements + creature/map + "b" "buffer" + "c" "comments" + "e" "errors" + "el" "lines" + "ex" "error message" + "f" "files" + "g" "magit" + "gf" "magit files" + "h" "help" + "q" "quit option" + "j" "jump") + + +(provide 'init-which-key)