~exported keymap settings to an elisp file

Keymap is a section of my config I edit quite a lot, and the org mode
format doesn't really fit with the way I edit it. Therefore I exported
it to an elisp file where I can quickly edit bits and pieces without a
lot of lag from explaining myself in org mode.
This commit is contained in:
dx
2020-07-20 21:10:33 +01:00
parent d8eb5ff020
commit 43d981e90b
2 changed files with 54 additions and 25 deletions

View File

@@ -0,0 +1,50 @@
;;; ~/Dotfiles/Doom/.config/doom/elisp/+keymap.el -*- lexical-binding: t; -*-
;;; Leader
(map!
:leader
;; Single binds
"SPC" #'execute-extended-command
"!" #'async-shell-command
"T" #'eshell
"C" #'calc
"-" #'dired-jump
"_" #'dired-jump-other-window
"w" #'ace-window
;; Personal
(:prefix ("m" . "personal")
:desc "Open books" "b" #'(lambda () (interactive) (dired (concat org-directory "/Books"))); I like my books
:desc "Convert auto-fill" "f" #'dx:org/fill-to-long-lines
:desc "Change theme" "t" #'dx:themes/set-new-theme ; From my own collection
:desc "Generate template" "g" #'+gentemplate/generate-template) ; From my own collection
;; Projectile
(:after projectile
(:prefix "f"
"g" #'projectile-regenerate-tags
"p" #'(lambda () (interactive) (doom-project-find-file "~/Dotfiles")))
">" #'projectile-switch-to-buffer)
;; Search
(:prefix "s"
(:after counsel-etags
"t" #'counsel-etags-find-tag)
(:after counsel
"s" #'counsel-grep-or-swiper
"r" #'counsel-rg))
;; Code
(:prefix "c"
"m" #'+make/run))
;;; Non leader
(map!
(:after evil
"TAB" #'evil-jump-item)
"M-v" #'dx:newline
"M-V" #'(lambda () (interactive) (dx:newline 1)))
;;; Remaps
(define-key!
[remap compile] #'compile)

View File

@@ -325,30 +325,9 @@ Define a major-mode for sxhkd config files.
"Simple mode for sxhkdrc files.") "Simple mode for sxhkdrc files.")
#+END_SRC #+END_SRC
* Key-map * Key-map
General keymap General keymap, load the keymap elisp file.
** Personal This elisp file is basically two big maps, which are better explained in that document than this one.
- Prefix "SPC m" (rebound from local-leader) that will hold personal keybinds for functions that I like using Furthermore, debugging and working on that document is something I do so often, it's just better to do it in an Elisp file than a org file.
- Mostly opening directories I use a lot or doing custom stuff that I can't really put in anything in particular
#+BEGIN_SRC elisp #+BEGIN_SRC elisp
(map! (load (concat doom-private-dir "+keymap.el"))
:leader
:prefix ("m" . "personal") ; Personal
:desc "Open books" "b" #'(lambda () (interactive) (dired (concat org-directory "/Books"))); I like my books
:desc "Convert auto-fill" "f" #'dx:org/fill-to-long-lines
:desc "Change theme" "t" #'dx:themes/set-new-theme ; From my own collection
:desc "Generate template" "g" #'+gentemplate/generate-template) ; From my own collection
#+END_SRC
** Remaps
Adding a new configuration option.
Remapping functions that other modules set to default functions.
#+BEGIN_SRC elisp
(define-key!
[remap compile] #'compile)
#+END_SRC
** Non-leader
Non-leader bindings for text-based commands.
#+BEGIN_SRC elisp
(map!
"M-v" #'dx:newline
"M-V" #'(lambda () (interactive) (dx:newline 1)))
#+END_SRC #+END_SRC