40 lines
1.1 KiB
EmacsLisp
40 lines
1.1 KiB
EmacsLisp
;; 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
|
|
(defun prot/keyboard-quit-dwim ()
|
|
(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))))
|
|
|
|
(define-key global-map (kbd "C-g") #'prot/keyboard-quit-dwim)
|
|
|
|
(global-set-key (kbd "C-x C-S-E") #'eval-buffer)
|
|
|
|
(global-set-key (kbd "C-c w") #'whitespace-mode)
|
|
|
|
(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)
|