;;; -*- lexical-binding: t -*- ;; ;; this file: ;; https://dataswamp.org/~incal/emacs-init/global-keys.el (require 'align-from-left) (require 'align-incal) (require 'buffer-menu) (require 'caps-back) (require 'edit) (require 'erc-connect) (require 'erc-incal) (require 'file-incal) (require 'fill-incal) (require 'find-command-zsh) (require 'gnus-incal) (require 'help-incal) (require 'kill) (require 'lisp-incal) (require 'revert-buffer) (require 'scroll) (require 'sort-incal) (require 'spell) (require 'super) (require 'w3m-incal) (require 'w3m-swamp) (require 'w3m-unisearch) (require 'window-incal) (require 'wrap-search) (require 'yank) ;; unbind (keymap-global-unset "C-h C-a") ; `about-emacs' (keymap-global-unset "C-h C-n") ; `view-emacs-news' (keymap-global-unset "C-h C-o") ; `describe-distribution' (keymap-global-unset "C-h C-p") ; `view-emacs-problems' (keymap-global-unset "C-h g") ; `describe-gnu-project' (keymap-global-unset "C-h h") ; `view-hello-file' (keymap-global-unset "C-h n") ; `view-emacs-news' (keymap-global-unset "C-h r") ; `info-emacs-manual' (keymap-global-unset "C-h t") ; `help-with-tutorial' (keymap-global-unset "C-l") ; `open-line' (keymap-global-unset "C-x C-c") ; `save-buffers-kill-terminal' (keymap-global-unset "C-x C-n") ; `set-goal-column' (keymap-global-unset "C-x C-z") ; `suspend-frame' (keymap-global-unset "C-z") ; `suspend-frame' ;; not used like that (keymap-global-unset "C-_") ; `undo', instead use M-0 (keymap-global-unset "C-x 0") ; `delete-window', M-p (keymap-global-unset "C-x 1") ; `delete-other-windows', M-p (keymap-global-unset "C-x C-u") ; `upcase-region', C-o r u (keymap-global-unset "C-x m") ; `compose-mail', C-i (keymap-global-unset "C-x o") ; `other-window', M-o (super-global-set "M-RET" #'find-file-at-point) (super-global-set "S-" #'dired-jump) ;; scroll horizontally (super-global-set "C-M-j" #'scroll-left-1) (super-global-set "C-M-l" #'scroll-right-1) ;; vertically 1 (super-global-set "M-i" #'scroll-up-1) (super-global-set "M-k" #'scroll-down-1) ;; panes (super-global-set "M-I" #'scroll-up-pane) (super-global-set "M-K" #'scroll-down-pane) ;; two windows (super-global-set "M-o" #'other-window-or-split) (super-global-set "M-p" #'delete-other-windows) ;; find function & zsh (keymap-global-set "C-o f" #'find-function) (keymap-global-set "C-o p" #'find-zsh-command-file-file) (keymap-global-set "C-o z" #'find-command-zsh) ;; permissions (keymap-global-set "C-o F" #'message-permissions) (keymap-global-set "C-o x" #'make-executable) ;; buffers (keymap-global-set "" #'buffer-menu-files-only) (keymap-global-set "C-x k" #'kill-current-buffer) (keymap-global-set "M-" #'switch-buffer) ;; help (keymap-global-set "C-h a" #'apropos) (keymap-global-set "C-h A" #'apropos-command) (keymap-global-set "C-h V" #'apropos-value) (keymap-global-set "C-o m" #'man-buc) (keymap-global-set "C-o C-o m" #'man-buc) (keymap-global-set "M-m" #'describe-variable-short) ;; repeat commands (super-global-set "M-a" #'do-repeat-complex-command) (super-global-set "M-A" #'repeat) ;; edit (keymap-global-set "C-a" #'back-to-dwim) (keymap-global-set "C-c j" #'push-to-col) (keymap-global-set "C-k" #'kill-line-remove-blanks) (keymap-global-set "C-M-y" #'yank-pop-back) (keymap-global-set "M-0" #'undo) (keymap-global-set "M-" #'toggle-caps-mode) (keymap-global-set "M-q" #'fill-down) (keymap-global-set "RET" #'newline-and-indent) ;; region (keymap-global-set "C-o r C" #'capitalize-region) (keymap-global-set "C-o r c" #'center-region) (keymap-global-set "C-o r d" #'downcase-region) (keymap-global-set "C-o r f" #'describe-face) (keymap-global-set "C-o r l" #'count-words-region) (keymap-global-set "C-o r s" #'sort-lines-whole) (keymap-global-set "C-o r u" #'upcase-region) ;; align (keymap-global-set "C-M-" #'align-from-left) (keymap-global-set "M-SPC" #'eat-space) ;; search (keymap-global-set "C-s" #'wrap-search) (keymap-global-set "C-r" #'wrap-search-again) ;; misc (keymap-global-set "M-2" #'erc-goto-irc) (keymap-global-set "M-9" #'eval-last-sexp) ;; spell (keymap-global-set "C-o e" #'spell-english) (keymap-global-set "C-o s" #'spell-swedish) ;; buffers (keymap-global-set "C-o C-o f" #'font-lock-fontify-buffer) (keymap-global-set "C-o l" #'revert-buffer-check) ;; top/bottom (keymap-global-set "C-o i" #'beginning-of-buffer) (keymap-global-set "C-o k" #'end-of-buffer) ;; Usenet/gmane/mail (keymap-global-set "C-" #'new-message) (super-global-set "C-l" #'gnus-switch-to-group-buffer) ;; w3m (keymap-global-set "C-o C-o i" #'wiki-search) (keymap-global-set "C-o C-o S" #'browse-swamp) (keymap-global-set "C-o C-o s" #'web-search) (keymap-global-set "C-o C-o w" #'w3m) (keymap-global-set "C-o C-o W" #'wiki-search) (provide 'global-keys)