2024-12-02 23:56:19 -05:00
|
|
|
;; move through windows (aka "panes") with C-arrowkeys
|
|
|
|
(windmove-default-keybindings 'control)
|
|
|
|
|
|
|
|
;; use "normal" (aka. non-default-emacs, or what most other apps do)
|
|
|
|
;; key bindings for C-z, C-x, C-c and C-v. C-x and C-c only do cut/copy
|
|
|
|
;; when a region is selected.
|
|
|
|
(cua-mode)
|
|
|
|
|
|
|
|
;; alternative key binding handler for C-g which does the following:
|
|
|
|
;; - if a region is active, disable it
|
|
|
|
;; - when the completions buffer is selected, close it
|
|
|
|
;; - if the minibuffer is open but not focused, close it
|
|
|
|
;; - otherwise, run keyboard-quit
|
2024-12-03 21:34:58 -05:00
|
|
|
(defun gered/keyboard-quit-dwim ()
|
2024-12-02 23:56:19 -05:00
|
|
|
(interactive)
|
|
|
|
(cond
|
|
|
|
((region-active-p)
|
|
|
|
(keyboard-quit))
|
|
|
|
((derived-mode-p 'completion-list-mode)
|
|
|
|
(delete-completion-window))
|
|
|
|
((> (minibuffer-depth) 0)
|
|
|
|
(abort-recursive-edit))
|
|
|
|
(t
|
|
|
|
(keyboard-quit))))
|
|
|
|
|
2024-12-03 22:23:50 -05:00
|
|
|
(global-set-key (kbd "C-g") #'gered/keyboard-quit-dwim)
|
2024-12-02 23:56:19 -05:00
|
|
|
|
2024-12-03 22:23:50 -05:00
|
|
|
(define-key emacs-lisp-mode-map (kbd "C-x C-S-E") #'eval-buffer)
|
2024-12-02 23:56:19 -05:00
|
|
|
|
|
|
|
(global-set-key (kbd "C-c w") #'whitespace-mode)
|
2024-12-03 20:56:01 -05:00
|
|
|
|
|
|
|
(defun gered/enable-and-open-menu-bar ()
|
|
|
|
(interactive)
|
|
|
|
(menu-bar-mode t)
|
|
|
|
(menu-bar-open))
|
|
|
|
|
|
|
|
(global-set-key (kbd "<f10>") #'gered/enable-and-open-menu-bar)
|
|
|
|
|
|
|
|
(global-set-key (kbd "M-<f10>") #'menu-bar-mode)
|
2024-12-07 13:10:34 -05:00
|
|
|
|
|
|
|
(global-set-key (kbd "C-x C-k") #'kill-this-buffer)
|
2024-12-08 14:01:52 -05:00
|
|
|
|
|
|
|
(global-set-key (kbd "C-SPC") #'completion-at-point)
|