Move key bindings from configuration.org to init.el

This commit is contained in:
Gergely Polonkai 2025-06-03 18:00:57 +02:00
parent e23fb67b30
commit 18d06a4aea
No known key found for this signature in database
GPG Key ID: 38F402C8471DDE93
2 changed files with 65 additions and 68 deletions

View File

@ -1,72 +1,4 @@
* Key bindings
#+begin_src emacs-lisp
(defvar gpolonkai/transpose-map (make-sparse-keymap)
"Map for transpose commands.")
(define-prefix-command 'gpolonkai/transpose-map)
(defvar gpolonkai/org-clock-map (make-sparse-keymap)
"Map for Org clocking commands.")
(define-prefix-command 'gpolonkai/org-clock-map)
(bind-keys
:map global-map
("<C-return>" . wted/open-line-below)
("<C-S-return>" . wted/open-line-above)
("C-~" . gpolonkai/toggle-char-case)
("C-a" . gpolonkai/move-to-beginning-of-line)
("C-e" . gpolonkai/move-to-end-of-line)
("M-F" . gpolonkai/beginning-of-next-word)
("C-h C-l" . find-library)
("C-h C-f" . find-function)
("C-h C-k" . find-function-on-key)
("C-h C-v" . find-variable)
("M-q" . sachachua/fill-or-unfill-paragraph)
("C-r" . isearch-backward-regexp)
("C-M-r" . isearch-backward)
("C-s" . isearch-forward-regexp)
("C-M-s" . isearch-forward)
("M-t" . gpolonkai/transpose-map)
("C-z" . nil)
:map mode-specific-map
;; TODO this should be doable from consult-projectiles config
("p p" . consult-projectile-switch-project)
("r" . gpolonkai/round-number-at-point-to-decimals)
:map gpolonkai/transpose-map
("c" . transpose-chars)
("e" . transpose-sexps)
("l" . transpose-lines)
("p" . transpose-paragraphs)
("s" . transpose-sentences)
("w" . transpose-words)
("W" . gpolonkai/transpose-windows)
:map gpolonkai/org-clock-map
("g" . org-clock-goto)
("i" . org-clock-in)
("I" . org-clock-in-last)
("o" . org-clock-out)
:map gpolonkai/pers-map
("c" . gpolonkai/org-clock-map)
("C-c" . calc)
("M-C" . clean-buffer-list)
("M-o" . mbork/insert-current-file-name-at-point)
("u" . browse-url-at-point)
:map ctl-x-map
("|" . gpolonkai/toggle-window-split)
("C-b" . bury-buffer)
("C-d" . wted/delete-current-buffer-file)
("k" . kill-current-buffer)
("C-r" . wted/rename-current-buffer-file)
("C-y" . duplicate-line)
:map isearch-mode-map
("<C-return>" . ep/isearch-exit-other-end)
("<S-return>" . e-se/isearch-exit-mark-match)
:map goto-map
("SPC" . gpolonkai/goto-next-char))
#+end_src
* And finally, start the Emacs server * And finally, start the Emacs server
Sometimes i start an ~emacsclient~ process, like for editing a commit message or something Sometimes i start an ~emacsclient~ process, like for editing a commit message or something
similar. As my startup time is pretty long, waiting for everything to complete is undesirable. similar. As my startup time is pretty long, waiting for everything to complete is undesirable.

65
init.el
View File

@ -1844,6 +1844,71 @@ Intended as a value for `bug-referecne-url-format'."
(use-package ansible-vault) (use-package ansible-vault)
;; Key bindings
(defvar gpolonkai/transpose-map (make-sparse-keymap)
"Map for transpose commands.")
(define-prefix-command 'gpolonkai/transpose-map)
(defvar gpolonkai/org-clock-map (make-sparse-keymap)
"Map for Org clocking commands.")
(define-prefix-command 'gpolonkai/org-clock-map)
(bind-keys
:map global-map
("<C-return>" . wted/open-line-below)
("<C-S-return>" . wted/open-line-above)
("C-~" . gpolonkai/toggle-char-case)
("C-a" . gpolonkai/move-to-beginning-of-line)
("C-e" . gpolonkai/move-to-end-of-line)
("M-F" . gpolonkai/beginning-of-next-word)
("C-h C-l" . find-library)
("C-h C-f" . find-function)
("C-h C-k" . find-function-on-key)
("C-h C-v" . find-variable)
("M-q" . sachachua/fill-or-unfill-paragraph)
("C-r" . isearch-backward-regexp)
("C-M-r" . isearch-backward)
("C-s" . isearch-forward-regexp)
("C-M-s" . isearch-forward)
("M-t" . gpolonkai/transpose-map)
("C-z" . nil)
:map mode-specific-map
;; TODO this should be doable from consult-projectiles config
("p p" . consult-projectile-switch-project)
("r" . gpolonkai/round-number-at-point-to-decimals)
:map gpolonkai/transpose-map
("c" . transpose-chars)
("e" . transpose-sexps)
("l" . transpose-lines)
("p" . transpose-paragraphs)
("s" . transpose-sentences)
("w" . transpose-words)
("W" . gpolonkai/transpose-windows)
:map gpolonkai/org-clock-map
("g" . org-clock-goto)
("i" . org-clock-in)
("I" . org-clock-in-last)
("o" . org-clock-out)
:map gpolonkai/pers-map
("c" . gpolonkai/org-clock-map)
("C-c" . calc)
("M-C" . clean-buffer-list)
("M-o" . mbork/insert-current-file-name-at-point)
("u" . browse-url-at-point)
:map ctl-x-map
("|" . gpolonkai/toggle-window-split)
("C-b" . bury-buffer)
("C-d" . wted/delete-current-buffer-file)
("k" . kill-current-buffer)
("C-r" . wted/rename-current-buffer-file)
("C-y" . duplicate-line)
:map isearch-mode-map
("<C-return>" . ep/isearch-exit-other-end)
("<S-return>" . e-se/isearch-exit-mark-match)
:map goto-map
("SPC" . gpolonkai/goto-next-char))
;; I started moving my configuration to this Org file. Its easier to document this way. ;; I started moving my configuration to this Org file. Its easier to document this way.
(org-babel-load-file (expand-file-name "configuration.org" user-emacs-directory)) (org-babel-load-file (expand-file-name "configuration.org" user-emacs-directory))