aboutsummaryrefslogtreecommitdiff
path: root/shoshin-config.el
diff options
context:
space:
mode:
Diffstat (limited to 'shoshin-config.el')
-rw-r--r--shoshin-config.el43
1 files changed, 43 insertions, 0 deletions
diff --git a/shoshin-config.el b/shoshin-config.el
index 3718296..c104247 100644
--- a/shoshin-config.el
+++ b/shoshin-config.el
@@ -29,6 +29,49 @@
(define-key 'xah-fly-leader-key-map (kbd "1") #'delete-other-windows)
+(defmacro with-map-defkey (keymap leader &rest pairs)
+ "Define a new KEYMAP with prefix key LEADER, and list of bindings in it."
+ (declare (indent 2))
+ `(progn
+ (defvar ,keymap (make-sparse-keymap))
+ (define-prefix-command (quote ,keymap))
+ (global-set-key (kbd ,leader) ,keymap)
+ (mapc (lambda (pair)
+ (define-key ,keymap
+ (kbd (if (numberp (car pair)) (number-to-string (car pair))
+ (symbol-name (car pair))))
+ (cadr pair)))
+ (quote ,(seq-partition pairs 2)))))
+
+(defvar *my-config* "~/projects/shoshimacs/shoshin-config.org"
+ "Path to my main configuration file.")
+
+(defun my-configuration ()
+ (interactive)
+ (find-file *my-config*))
+
+(defun my-reload-config ()
+ "Tangles and reloads a literate config with `org-babel-load-file'"
+ (interactive)
+ (org-babel-load-file *my-config*))
+
+(with-map-defkey my-key-map "M-m"
+ 1 delete-other-windows
+ a apropos
+ b consult-buffer
+ c my-config
+ d embark-act
+ e eshell
+ f find-file
+ g magit
+ h info
+ i consult-imenu
+ j describe-function
+ k describe-variable
+ t consult-theme
+ w which-key-mode
+ <f1> my-reload-config)
+
;;; Completion
(setq completion-styles '(flex basic partial-completion emacs22)
completion-cycle-threshold 3