Commit 71893b57ceb3

Vincent Demeester <vincent@sbr.pm>
2025-03-11 16:28:35
tools/emacs: add general configuration…
… and move config-keybindings to "interactive" Signed-off-by: Vincent Demeester <vincent@sbr.pm>
1 parent 4f90e9d
Changed files (2)
tools/emacs/config/config-keybindings.el
@@ -10,6 +10,56 @@
 ;; See https://www.masteringemacs.org/article/text-expansion-hippie-expand
 (global-set-key [remap dabbrev-expand] 'hippie-expand)
 
+;; TODO add general configuration here
+(use-package general
+  :config
+  (dolist (key '("C-M-<SPC>" "M-<SPC>"))
+    (global-unset-key (kbd key)))
+  (general-create-definer general-leader :prefix "M-<SPC>")
+  (general-def "C-M-<SPC>" 'cycle-spacing)
+
+  (general-leader
+   "f"   '(:ignore t :wk ("File" . "File prefix"))
+   "ff"  #'(project-find-file :wk "Find in Project")
+   ))
+
+;; (use-package general
+;;   :config
+;;   (general-define-key
+;;    :states '(normal visual insert emacs)
+;;    :prefix "SPC"
+;;    :non-normal-prefix "M-SPC"
+;;    "SPC" '(counsel-M-x :which-key "M-x")
+;;    "TAB" '(switch-to-prev-buffer :which-key "previous buffer")
+;;    "b" '(:ignore t :which-key "buffer")
+;;    "bb" '(counsel-switch-buffer :which-key "switch buffer")
+;;    "bd" '(kill-current-buffer :which-key "kill buffer")
+;;    "bn" '(next-buffer :which-key "next buffer")
+;;    "bp" '(previous-buffer :which-key "previous buffer")
+;;    "e" '(:ignore t :which-key "edit")
+;;    "ee" '(eval-last-sexp :which-key "eval last sexp")
+;;    "f" '(:ignore t :which-key "file")
+;;    "ff" '(counsel-find-file :which-key "find file")
+;;    "fs" '(save-buffer :which-key "save file")
+;;    "g" '(:ignore t :which-key "git")
+;;    "gs" '(magit-status :which-key "magit status")
+;;    "h" '(:ignore t :which-key "help")
+;;    "hf" '(describe-function :which-key "describe function")
+;;    "hk" '(describe-key :which-key "describe key")
+;;    "hv" '(describe-variable :which-key "describe variable")
+;;    "p" '(:ignore t :which-key "project")
+;;    "pf" '(counsel-projectile-find-file :which-key "find file")
+;;    "pp" '(counsel-projectile-switch-project :which-key "switch project")
+;;    "q" '(:ignore t :which-key "quit")
+;;    "qq" '(save-buffers-kill-terminal :which-key "quit emacs")
+;;    "s" '(:ignore t :which-key "search")
+;;    "ss" '(swiper :which-key "swiper")
+;;    "w" '(:ignore t :which-key "window")
+;;    "wd" '(delete-window :which-key "delete window")
+;;    "wh" '(windmove-left :which-key "move left")
+;;    "wj" '(windmove-down :which-key "move down")
+;;    "wk" '(windmove-up :which-key "move up")
+;;    "wl" '(windmove-right :which-key )))
 
 ;; 
 (provide 'config-keybindings)
tools/emacs/init.el
@@ -249,9 +249,9 @@ The DWIM behaviour of this command is as follows:
 (require '00-clean) ;; Maybe refactor no-littering
 (require 'config-editing)
 (require 'config-files)
-(require 'config-keybindings)
 (require 'config-misc)
 (unless noninteractive
+  (require 'config-keybindings)
   (require 'config-appearance)
   (require 'config-buffers)
   (require 'config-compile)