2

My .emacs file is over 1500 lines long mainly because of unbinding a ton of global keybinds.

I've searched all over and could find no tutorials for making a fully customized keymap from scratch.

I know I can totally obliterate the global keymap by (use-global-map (make-sparse-keymap)).
But where do I go from there?

;;-----------------------------------------------------------------;;
;;-----------------------------------------------------------------;;
;;-----------------------------------------------------------------;;
;;-------------------------KEYBINDINGS-----------------------------;;
;;-----------------------------------------------------------------;;
;;-----------------------------------------------------------------;;
;;-----------------------------------------------------------------;;

;; Nothing
(defun x ()
  (interactive)
  (message "NULL"))

(require 'bind-key)

(define-key input-decode-map [?\C-i] (kbd "<C-i>"))
(define-key input-decode-map [?\C-\S-i] (kbd "<C-S-i>"))
(define-key input-decode-map [?\C-m] (kbd "<C-m>"))

;;-----------------------------------------------------------------;;
;;-------------------------UNBOUND KEYS----------------------------;;
;;-----------------------------------------------------------------;;

;; Numbers And Symbols
(bind-key* "C-`" 'x)
(bind-key* "C-1" 'x)
(bind-key* "C-2" 'x)
(bind-key* "C-3" 'x)
(bind-key* "C-4" 'x)
(bind-key* "C-5" 'x)
(bind-key* "C-6" 'x)
(bind-key* "C-7" 'x)
(bind-key* "C-8" 'x)
(bind-key* "C-9" 'x)
(bind-key* "C-0" 'x)
(bind-key* "C--" 'x)
(bind-key* "C-=" 'x)

(bind-key* "C-~" 'x)
(bind-key* "C-!" 'x)
(bind-key* "C-@" 'x)
(bind-key* "C-#" 'x)
(bind-key* "C-$" 'x)
(bind-key* "C-%" 'x)
(bind-key* "C-^" 'x)
(bind-key* "C-&" 'x)
(bind-key* "C-*" 'x)
(bind-key* "C-(" 'x)
(bind-key* "C-)" 'x)
(bind-key* "C-_" 'x)
(bind-key* "C-+" 'x)

(bind-key* "M-`" 'x)
(bind-key* "M-1" 'x)
(bind-key* "M-2" 'x)
(bind-key* "M-3" 'x)
(bind-key* "M-4" 'x)
(bind-key* "M-5" 'x)
(bind-key* "M-6" 'x)
(bind-key* "M-7" 'x)
(bind-key* "M-8" 'x)
(bind-key* "M-9" 'x)
(bind-key* "M-0" 'x)
(bind-key* "M--" 'x)
(bind-key* "M-=" 'x)

(bind-key* "M-~" 'x)
(bind-key* "M-!" 'x)
(bind-key* "M-@" 'x)
(bind-key* "M-#" 'x)
(bind-key* "M-$" 'x)
(bind-key* "M-%" 'x)
(bind-key* "M-^" 'x)
(bind-key* "M-&" 'x)
(bind-key* "M-*" 'x)
(bind-key* "M-(" 'x)
(bind-key* "M-)" 'x)
(bind-key* "M-_" 'x)
(bind-key* "M-+" 'x)

(bind-key* "C-M-`" 'x)
(bind-key* "C-M-1" 'x)
(bind-key* "C-M-2" 'x)
(bind-key* "C-M-3" 'x)
(bind-key* "C-M-4" 'x)
(bind-key* "C-M-5" 'x)
(bind-key* "C-M-6" 'x)
(bind-key* "C-M-7" 'x)
(bind-key* "C-M-8" 'x)
(bind-key* "C-M-9" 'x)
(bind-key* "C-M-0" 'x)
(bind-key* "C-M--" 'x)
(bind-key* "C-M-=" 'x)

(bind-key* "C-M-~" 'x)
(bind-key* "C-M-!" 'x)
(bind-key* "C-M-@" 'x)
(bind-key* "C-M-#" 'x)
(bind-key* "C-M-$" 'x)
(bind-key* "C-M-%" 'x)
(bind-key* "C-M-^" 'x)
(bind-key* "C-M-&" 'x)
(bind-key* "C-M-*" 'x)
(bind-key* "C-M-(" 'x)
(bind-key* "C-M-)" 'x)
(bind-key* "C-M-_" 'x)
(bind-key* "C-M-+" 'x)
;; End Numbers And Symbols

;; Letters And Symbols
(bind-key* "C-a" 'x)
(bind-key* "C-b" 'x)
(bind-key* "C-d" 'x)
(bind-key* "C-e" 'x)
(bind-key* "C-f" 'x)
(bind-key* "C-g" 'x)
(bind-key* "C-h" 'x)
(bind-key* "C-k" 'x)
(bind-key* "C-n" 'x)
(bind-key* "C-o" 'x)
(bind-key* "C-p" 'x)
(bind-key* "C-q" 'x)
(bind-key* "C-r" 'x)
(bind-key* "C-s" 'x)
(bind-key* "C-t" 'x)
(bind-key* "C-u" 'x)
(bind-key* "C-v" 'x)
(bind-key* "C-w" 'x)
(bind-key* "C-y" 'x)
(bind-key* "C-z" 'x)
(bind-key* "C-]" 'x)
(bind-key* "C-\\" 'x)
(bind-key* "C-;" 'x)
(bind-key* "C-'" 'x)
(bind-key* "C-," 'x)
(bind-key* "C-." 'x)
(bind-key* "C-/" 'x)

(bind-key* "C-A" 'x)
(bind-key* "C-B" 'x)
(bind-key* "C-D" 'x)
(bind-key* "C-E" 'x)
(bind-key* "C-F" 'x)
(bind-key* "C-G" 'x)
(bind-key* "C-H" 'x)
(bind-key* "C-K" 'x)
(bind-key* "C-N" 'x)
(bind-key* "C-O" 'x)
(bind-key* "C-P" 'x)
(bind-key* "C-Q" 'x)
(bind-key* "C-R" 'x)
(bind-key* "C-S" 'x)
(bind-key* "C-T" 'x)
(bind-key* "C-U" 'x)
(bind-key* "C-V" 'x)
(bind-key* "C-W" 'x)
(bind-key* "C-Y" 'x)
(bind-key* "C-Z" 'x)
(bind-key* "C-{" 'x)
(bind-key* "C-}" 'x)
(bind-key* "C-|" 'x)
(bind-key* "C-:" 'x)
(bind-key* "C-\"" 'x)
(bind-key* "C-<" 'x)
(bind-key* "C->" 'x)
(bind-key* "C-?" 'x)

(bind-key* "M-a" 'x)
(bind-key* "M-b" 'x)
(bind-key* "M-c" 'x)
(bind-key* "M-d" 'x)
(bind-key* "M-e" 'x)
(bind-key* "M-f" 'x)
(bind-key* "M-g" 'x)
(bind-key* "M-h" 'x)
(bind-key* "M-i" 'x)
(bind-key* "M-j" 'x)
(bind-key* "M-k" 'x)
(bind-key* "M-l" 'x)
(bind-key* "M-m" 'x)
(bind-key* "M-n" 'x)
(bind-key* "M-o" 'x)
(bind-key* "M-p" 'x)
(bind-key* "M-q" 'x)
(bind-key* "M-r" 'x)
(bind-key* "M-s" 'x)
(bind-key* "M-t" 'x)
(bind-key* "M-u" 'x)
(bind-key* "M-v" 'x)
(bind-key* "M-w" 'x)
(bind-key* "M-y" 'x)
(bind-key* "M-z" 'x)
(bind-key* "M-[" 'x)
(bind-key* "M-]" 'x)
(bind-key* "M-\\" 'x)
(bind-key* "M-;" 'x)
(bind-key* "M-'" 'x)
(bind-key* "M-," 'x)
(bind-key* "M-." 'x)
(bind-key* "M-/" 'x)

(bind-key* "M-A" 'x)
(bind-key* "M-B" 'x)
(bind-key* "M-C" 'x)
(bind-key* "M-D" 'x)
(bind-key* "M-E" 'x)
(bind-key* "M-F" 'x)
(bind-key* "M-G" 'x)
(bind-key* "M-H" 'x)
(bind-key* "M-M" 'x)
(bind-key* "M-N" 'x)
(bind-key* "M-P" 'x)
(bind-key* "M-Q" 'x)
(bind-key* "M-R" 'x)
(bind-key* "M-S" 'x)
(bind-key* "M-T" 'x)
(bind-key* "M-V" 'x)
(bind-key* "M-W" 'x)
(bind-key* "M-Y" 'x)
(bind-key* "M-Z" 'x)
(bind-key* "M-{" 'x)
(bind-key* "M-}" 'x)
(bind-key* "M-|" 'x)
(bind-key* "M-:" 'x)
(bind-key* "M-\"" 'x)
(bind-key* "M-<" 'x)
(bind-key* "M->" 'x)
(bind-key* "M-?" 'x)

(bind-key* "C-M-a" 'x)
(bind-key* "C-M-b" 'x)
(bind-key* "C-M-c" 'x)
(bind-key* "C-M-d" 'x)
(bind-key* "C-M-e" 'x)
(bind-key* "C-M-f" 'x)
(bind-key* "C-M-g" 'x)
(bind-key* "C-M-h" 'x)
(bind-key* "C-M-i" 'x)
(bind-key* "C-M-j" 'x)
(bind-key* "C-M-k" 'x)
(bind-key* "C-M-l" 'x)
(bind-key* "C-M-m" 'x)
(bind-key* "C-M-n" 'x)
(bind-key* "C-M-o" 'x)
(bind-key* "C-M-p" 'x)
(bind-key* "C-M-q" 'x)
(bind-key* "C-M-r" 'x)
(bind-key* "C-M-s" 'x)
(bind-key* "C-M-t" 'x)
(bind-key* "C-M-u" 'x)
(bind-key* "C-M-v" 'x)
(bind-key* "C-M-w" 'x)
(bind-key* "C-M-x" 'x)
(bind-key* "C-M-y" 'x)
(bind-key* "C-M-z" 'x)
(bind-key* "C-M-[" 'x)
(bind-key* "C-M-]" 'x)
(bind-key* "C-M-\\" 'x)
(bind-key* "C-M-;" 'x)
(bind-key* "C-M-'" 'x)
(bind-key* "C-M-," 'x)
(bind-key* "C-M-." 'x)
(bind-key* "C-M-/" 'x)

(bind-key* "C-M-A" 'x)
(bind-key* "C-M-B" 'x)
(bind-key* "C-M-C" 'x)
(bind-key* "C-M-D" 'x)
(bind-key* "C-M-E" 'x)
(bind-key* "C-M-F" 'x)
(bind-key* "C-M-G" 'x)
(bind-key* "C-M-H" 'x)
(bind-key* "C-M-I" 'x)
(bind-key* "C-M-J" 'x)
(bind-key* "C-M-K" 'x)
(bind-key* "C-M-L" 'x)
(bind-key* "C-M-M" 'x)
(bind-key* "C-M-N" 'x)
(bind-key* "C-M-O" 'x)
(bind-key* "C-M-P" 'x)
(bind-key* "C-M-Q" 'x)
(bind-key* "C-M-R" 'x)
(bind-key* "C-M-S" 'x)
(bind-key* "C-M-T" 'x)
(bind-key* "C-M-U" 'x)
(bind-key* "C-M-V" 'x)
(bind-key* "C-M-W" 'x)
(bind-key* "C-M-X" 'x)
(bind-key* "C-M-Y" 'x)
(bind-key* "C-M-Z" 'x)
(bind-key* "C-M-{" 'x)
(bind-key* "C-M-}" 'x)
(bind-key* "C-M-|" 'x)
(bind-key* "C-M-:" 'x)
(bind-key* "C-M-\"" 'x)
(bind-key* "C-M-<" 'x)
(bind-key* "C-M->" 'x)
(bind-key* "C-M-?" 'x)
;; End Letters And Symbols

;; Numbers And Symbols With C-x Prefix
(bind-key* "C-x `" 'x)
(bind-key* "C-x 1" 'x)
(bind-key* "C-x 2" 'x)
(bind-key* "C-x 3" 'x)
(bind-key* "C-x 4" 'x)
(bind-key* "C-x 5" 'x)
(bind-key* "C-x 6" 'x)
(bind-key* "C-x 7" 'x)
(bind-key* "C-x 8" 'x)
(bind-key* "C-x 9" 'x)
(bind-key* "C-x 0" 'x)
(bind-key* "C-x -" 'x)
(bind-key* "C-x =" 'x)

(bind-key* "C-x ~" 'x)
(bind-key* "C-x !" 'x)
(bind-key* "C-x @" 'x)
(bind-key* "C-x #" 'x)
(bind-key* "C-x $" 'x)
(bind-key* "C-x %" 'x)
(bind-key* "C-x ^" 'x)
(bind-key* "C-x &" 'x)
(bind-key* "C-x *" 'x)
(bind-key* "C-x (" 'x)
(bind-key* "C-x )" 'x)
(bind-key* "C-x _" 'x)
(bind-key* "C-x +" 'x)

(bind-key* "C-x C-`" 'x)
(bind-key* "C-x C-1" 'x)
(bind-key* "C-x C-2" 'x)
(bind-key* "C-x C-3" 'x)
(bind-key* "C-x C-4" 'x)
(bind-key* "C-x C-5" 'x)
(bind-key* "C-x C-6" 'x)
(bind-key* "C-x C-7" 'x)
(bind-key* "C-x C-8" 'x)
(bind-key* "C-x C-9" 'x)
(bind-key* "C-x C-0" 'x)
(bind-key* "C-x C--" 'x)
(bind-key* "C-x C-=" 'x)

(bind-key* "C-x C-~" 'x)
(bind-key* "C-x C-!" 'x)
(bind-key* "C-x C-@" 'x)
(bind-key* "C-x C-#" 'x)
(bind-key* "C-x C-$" 'x)
(bind-key* "C-x C-%" 'x)
(bind-key* "C-x C-^" 'x)
(bind-key* "C-x C-&" 'x)
(bind-key* "C-x C-*" 'x)
(bind-key* "C-x C-(" 'x)
(bind-key* "C-x C-)" 'x)
(bind-key* "C-x C-_" 'x)
(bind-key* "C-x C-+" 'x)

(bind-key* "C-x M-`" 'x)
(bind-key* "C-x M-1" 'x)
(bind-key* "C-x M-2" 'x)
(bind-key* "C-x M-3" 'x)
(bind-key* "C-x M-4" 'x)
(bind-key* "C-x M-5" 'x)
(bind-key* "C-x M-6" 'x)
(bind-key* "C-x M-7" 'x)
(bind-key* "C-x M-8" 'x)
(bind-key* "C-x M-9" 'x)
(bind-key* "C-x M-0" 'x)
(bind-key* "C-x M--" 'x)
(bind-key* "C-x M-=" 'x)

(bind-key* "C-x M-~" 'x)
(bind-key* "C-x M-!" 'x)
(bind-key* "C-x M-@" 'x)
(bind-key* "C-x M-#" 'x)
(bind-key* "C-x M-$" 'x)
(bind-key* "C-x M-%" 'x)
(bind-key* "C-x M-^" 'x)
(bind-key* "C-x M-&" 'x)
(bind-key* "C-x M-*" 'x)
(bind-key* "C-x M-(" 'x)
(bind-key* "C-x M-)" 'x)
(bind-key* "C-x M-_" 'x)
(bind-key* "C-x M-+" 'x)

(bind-key* "C-x C-M-`" 'x)
(bind-key* "C-x C-M-1" 'x)
(bind-key* "C-x C-M-2" 'x)
(bind-key* "C-x C-M-3" 'x)
(bind-key* "C-x C-M-4" 'x)
(bind-key* "C-x C-M-5" 'x)
(bind-key* "C-x C-M-6" 'x)
(bind-key* "C-x C-M-7" 'x)
(bind-key* "C-x C-M-8" 'x)
(bind-key* "C-x C-M-9" 'x)
(bind-key* "C-x C-M-0" 'x)
(bind-key* "C-x C-M--" 'x)
(bind-key* "C-x C-M-=" 'x)

(bind-key* "C-x C-M-~" 'x)
(bind-key* "C-x C-M-!" 'x)
(bind-key* "C-x C-M-@" 'x)
(bind-key* "C-x C-M-#" 'x)
(bind-key* "C-x C-M-$" 'x)
(bind-key* "C-x C-M-%" 'x)
(bind-key* "C-x C-M-^" 'x)
(bind-key* "C-x C-M-&" 'x)
(bind-key* "C-x C-M-*" 'x)
(bind-key* "C-x C-M-(" 'x)
(bind-key* "C-x C-M-)" 'x)
(bind-key* "C-x C-M-_" 'x)
(bind-key* "C-x C-M-+" 'x)
;; End Numbers And Symbols With C-x Prefix

;; Letters And Symbols With C-x Prefix
(bind-key* "C-x a" 'x)
(bind-key* "C-x b" 'x)
(bind-key* "C-x c" 'x)
(bind-key* "C-x d" 'x)
(bind-key* "C-x e" 'x)
(bind-key* "C-x f" 'x)
(bind-key* "C-x g" 'x)
(bind-key* "C-x h" 'x)
(bind-key* "C-x i" 'x)
(bind-key* "C-x j" 'x)
(bind-key* "C-x k" 'x)
(bind-key* "C-x l" 'x)
(bind-key* "C-x m" 'x)
(bind-key* "C-x n" 'x)
(bind-key* "C-x o" 'x)
(bind-key* "C-x p" 'x)
(bind-key* "C-x q" 'x)
(bind-key* "C-x r" 'x)
(bind-key* "C-x s" 'x)
(bind-key* "C-x t" 'x)
(bind-key* "C-x u" 'x)
(bind-key* "C-x v" 'x)
(bind-key* "C-x w" 'x)
(bind-key* "C-x x" 'x)
(bind-key* "C-x y" 'x)
(bind-key* "C-x z" 'x)
(bind-key* "C-x [" 'x)
(bind-key* "C-x ]" 'x)
(bind-key* "C-x \\" 'x)
(bind-key* "C-x ;" 'x)
(bind-key* "C-x '" 'x)
(bind-key* "C-x ," 'x)
(bind-key* "C-x ." 'x)
(bind-key* "C-x /" 'x)

(bind-key* "C-x A" 'x)
(bind-key* "C-x B" 'x)
(bind-key* "C-x C" 'x)
(bind-key* "C-x D" 'x)
(bind-key* "C-x E" 'x)
(bind-key* "C-x F" 'x)
(bind-key* "C-x G" 'x)
(bind-key* "C-x H" 'x)
(bind-key* "C-x I" 'x)
(bind-key* "C-x J" 'x)
(bind-key* "C-x K" 'x)
(bind-key* "C-x L" 'x)
(bind-key* "C-x M" 'x)
(bind-key* "C-x N" 'x)
(bind-key* "C-x O" 'x)
(bind-key* "C-x P" 'x)
(bind-key* "C-x Q" 'x)
(bind-key* "C-x R" 'x)
(bind-key* "C-x S" 'x)
(bind-key* "C-x T" 'x)
(bind-key* "C-x U" 'x)
(bind-key* "C-x V" 'x)
(bind-key* "C-x W" 'x)
(bind-key* "C-x X" 'x)
(bind-key* "C-x Y" 'x)
(bind-key* "C-x Z" 'x)
(bind-key* "C-x {" 'x)
(bind-key* "C-x }" 'x)
(bind-key* "C-x |" 'x)
(bind-key* "C-x :" 'x)
(bind-key* "C-x \"" 'x)
(bind-key* "C-x <" 'x)
(bind-key* "C-x >" 'x)
(bind-key* "C-x ?" 'x)

cont...... (maxed out character limit)

(bind-key* "C-c C-~" 'x)
(bind-key* "C-c C-!" 'x)
(bind-key* "C-c C-@" 'x)
(bind-key* "C-c C-#" 'x)
(bind-key* "C-c C-$" 'x)
(bind-key* "C-c C-%" 'x)
(bind-key* "C-c C-^" 'x)
(bind-key* "C-c C-&" 'x)
(bind-key* "C-c C-*" 'x)
(bind-key* "C-c C-(" 'x)
(bind-key* "C-c C-)" 'x)
(bind-key* "C-c C-_" 'x)
(bind-key* "C-c C-+" 'x)

(bind-key* "C-c M-`" 'x)
(bind-key* "C-c M-1" 'x)
(bind-key* "C-c M-2" 'x)
(bind-key* "C-c M-3" 'x)
(bind-key* "C-c M-4" 'x)
(bind-key* "C-c M-5" 'x)
(bind-key* "C-c M-6" 'x)
(bind-key* "C-c M-7" 'x)
(bind-key* "C-c M-8" 'x)
(bind-key* "C-c M-9" 'x)
(bind-key* "C-c M-0" 'x)
(bind-key* "C-c M--" 'x)
(bind-key* "C-c M-=" 'x)

(bind-key* "C-c M-~" 'x)
(bind-key* "C-c M-!" 'x)
(bind-key* "C-c M-@" 'x)
(bind-key* "C-c M-#" 'x)
(bind-key* "C-c M-$" 'x)
(bind-key* "C-c M-%" 'x)
(bind-key* "C-c M-^" 'x)
(bind-key* "C-c M-&" 'x)
(bind-key* "C-c M-*" 'x)
(bind-key* "C-c M-(" 'x)
(bind-key* "C-c M-)" 'x)
(bind-key* "C-c M-_" 'x)
(bind-key* "C-c M-+" 'x)

(bind-key* "C-c C-M-`" 'x)
(bind-key* "C-c C-M-1" 'x)
(bind-key* "C-c C-M-2" 'x)
(bind-key* "C-c C-M-3" 'x)
(bind-key* "C-c C-M-4" 'x)
(bind-key* "C-c C-M-5" 'x)
(bind-key* "C-c C-M-6" 'x)
(bind-key* "C-c C-M-7" 'x)
(bind-key* "C-c C-M-8" 'x)
(bind-key* "C-c C-M-9" 'x)
(bind-key* "C-c C-M-0" 'x)
(bind-key* "C-c C-M--" 'x)
(bind-key* "C-c C-M-=" 'x)

(bind-key* "C-c C-M-~" 'x)
(bind-key* "C-c C-M-!" 'x)
(bind-key* "C-c C-M-@" 'x)
(bind-key* "C-c C-M-#" 'x)
(bind-key* "C-c C-M-$" 'x)
(bind-key* "C-c C-M-%" 'x)
(bind-key* "C-c C-M-^" 'x)
(bind-key* "C-c C-M-&" 'x)
(bind-key* "C-c C-M-*" 'x)
(bind-key* "C-c C-M-(" 'x)
(bind-key* "C-c C-M-)" 'x)
(bind-key* "C-c C-M-_" 'x)
(bind-key* "C-c C-M-+" 'x)
;; End Numbers And Symbols With C-c Prefix

;; Letters And Symbols With C-c Prefix
(bind-key* "C-c a" 'x)
(bind-key* "C-c b" 'x)
(bind-key* "C-c c" 'x)
(bind-key* "C-c d" 'x)
(bind-key* "C-c e" 'x)
(bind-key* "C-c f" 'x)
(bind-key* "C-c g" 'x)
(bind-key* "C-c h" 'x)
(bind-key* "C-c i" 'x)
(bind-key* "C-c j" 'x)
(bind-key* "C-c k" 'x)
(bind-key* "C-c l" 'x)
(bind-key* "C-c m" 'x)
(bind-key* "C-c n" 'x)
(bind-key* "C-c o" 'x)
(bind-key* "C-c p" 'x)
(bind-key* "C-c q" 'x)
(bind-key* "C-c r" 'x)
(bind-key* "C-c s" 'x)
(bind-key* "C-c t" 'x)
(bind-key* "C-c u" 'x)
(bind-key* "C-c v" 'x)
(bind-key* "C-c w" 'x)
(bind-key* "C-c x" 'x)
(bind-key* "C-c y" 'x)
(bind-key* "C-c z" 'x)
(bind-key* "C-c [" 'x)
(bind-key* "C-c ]" 'x)
(bind-key* "C-c \\" 'x)
(bind-key* "C-c ;" 'x)
(bind-key* "C-c '" 'x)
(bind-key* "C-c ," 'x)
(bind-key* "C-c ." 'x)
(bind-key* "C-c /" 'x)

(bind-key* "C-c A" 'x)
(bind-key* "C-c B" 'x)
(bind-key* "C-c C" 'x)
(bind-key* "C-c D" 'x)
(bind-key* "C-c E" 'x)
(bind-key* "C-c F" 'x)
(bind-key* "C-c G" 'x)
(bind-key* "C-c H" 'x)
(bind-key* "C-c I" 'x)
(bind-key* "C-c J" 'x)
(bind-key* "C-c K" 'x)
(bind-key* "C-c L" 'x)
(bind-key* "C-c M" 'x)
(bind-key* "C-c N" 'x)
(bind-key* "C-c O" 'x)
(bind-key* "C-c P" 'x)
(bind-key* "C-c Q" 'x)
(bind-key* "C-c R" 'x)
(bind-key* "C-c S" 'x)
(bind-key* "C-c T" 'x)
(bind-key* "C-c U" 'x)
(bind-key* "C-c V" 'x)
(bind-key* "C-c W" 'x)
(bind-key* "C-c X" 'x)
(bind-key* "C-c Y" 'x)
(bind-key* "C-c Z" 'x)
(bind-key* "C-c {" 'x)
(bind-key* "C-c }" 'x)
(bind-key* "C-c |" 'x)
(bind-key* "C-c :" 'x)
(bind-key* "C-c \"" 'x)
(bind-key* "C-c <" 'x)
(bind-key* "C-c >" 'x)
(bind-key* "C-c ?" 'x)

(bind-key* "C-c C-a" 'x)
(bind-key* "C-c C-b" 'x)
(bind-key* "C-c C-c" 'x)
(bind-key* "C-c C-d" 'x)
(bind-key* "C-c C-e" 'x)
(bind-key* "C-c C-f" 'x)
(bind-key* "C-c C-g" 'x)
(bind-key* "C-c C-h" 'x)
(bind-key* "C-c C-i" 'x)
(bind-key* "C-c C-j" 'x)
(bind-key* "C-c C-k" 'x)
(bind-key* "C-c C-l" 'x)
(bind-key* "C-c C-m" 'x)
(bind-key* "C-c C-n" 'x)
(bind-key* "C-c C-o" 'x)
(bind-key* "C-c C-p" 'x)
(bind-key* "C-c C-q" 'x)
(bind-key* "C-c C-r" 'x)
(bind-key* "C-c C-s" 'x)
(bind-key* "C-c C-t" 'x)
(bind-key* "C-c C-u" 'x)
(bind-key* "C-c C-v" 'x)
(bind-key* "C-c C-w" 'x)
(bind-key* "C-c C-x" 'x)
(bind-key* "C-c C-y" 'x)
(bind-key* "C-c C-z" 'x)
(bind-key* "C-c C-]" 'x)
(bind-key* "C-c C-\\" 'x)
(bind-key* "C-c C-;" 'x)
(bind-key* "C-c C-'" 'x)
(bind-key* "C-c C-," 'x)
(bind-key* "C-c C-." 'x)
(bind-key* "C-c C-/" 'x)

(bind-key* "C-c C-A" 'x)
(bind-key* "C-c C-B" 'x)
(bind-key* "C-c C-C" 'x)
(bind-key* "C-c C-D" 'x)
(bind-key* "C-c C-E" 'x)
(bind-key* "C-c C-F" 'x)
(bind-key* "C-c C-G" 'x)
(bind-key* "C-c C-H" 'x)
(bind-key* "C-c C-I" 'x)
(bind-key* "C-c C-J" 'x)
(bind-key* "C-c C-K" 'x)
(bind-key* "C-c C-L" 'x)
(bind-key* "C-c C-M" 'x)
(bind-key* "C-c C-N" 'x)
(bind-key* "C-c C-O" 'x)
(bind-key* "C-c C-P" 'x)
(bind-key* "C-c C-Q" 'x)
(bind-key* "C-c C-R" 'x)
(bind-key* "C-c C-S" 'x)
(bind-key* "C-c C-T" 'x)
(bind-key* "C-c C-U" 'x)
(bind-key* "C-c C-V" 'x)
(bind-key* "C-c C-W" 'x)
(bind-key* "C-c C-X" 'x)
(bind-key* "C-c C-Y" 'x)
(bind-key* "C-c C-Z" 'x)
(bind-key* "C-c C-{" 'x)
(bind-key* "C-c C-}" 'x)
(bind-key* "C-c C-|" 'x)
(bind-key* "C-c C-:" 'x)
(bind-key* "C-c C-\"" 'x)
(bind-key* "C-c C-<" 'x)
(bind-key* "C-c C->" 'x)
(bind-key* "C-c C-?" 'x)

(bind-key* "C-c M-a" 'x)
(bind-key* "C-c M-b" 'x)
(bind-key* "C-c M-c" 'x)
(bind-key* "C-c M-d" 'x)
(bind-key* "C-c M-e" 'x)
(bind-key* "C-c M-f" 'x)
(bind-key* "C-c M-g" 'x)
(bind-key* "C-c M-h" 'x)
(bind-key* "C-c M-i" 'x)
(bind-key* "C-c M-j" 'x)
(bind-key* "C-c M-k" 'x)
(bind-key* "C-c M-l" 'x)
(bind-key* "C-c M-m" 'x)
(bind-key* "C-c M-n" 'x)
(bind-key* "C-c M-o" 'x)
(bind-key* "C-c M-p" 'x)
(bind-key* "C-c M-q" 'x)
(bind-key* "C-c M-r" 'x)
(bind-key* "C-c M-s" 'x)
(bind-key* "C-c M-t" 'x)
(bind-key* "C-c M-u" 'x)
(bind-key* "C-c M-v" 'x)
(bind-key* "C-c M-w" 'x)
(bind-key* "C-c M-x" 'x)
(bind-key* "C-c M-y" 'x)
(bind-key* "C-c M-z" 'x)
(bind-key* "C-c M-[" 'x)
(bind-key* "C-c M-]" 'x)
(bind-key* "C-c M-\\" 'x)
(bind-key* "C-c M-;" 'x)
(bind-key* "C-c M-'" 'x)
(bind-key* "C-c M-," 'x)
(bind-key* "C-c M-." 'x)
(bind-key* "C-c M-/" 'x)

(bind-key* "C-c M-A" 'x)
(bind-key* "C-c M-B" 'x)
(bind-key* "C-c M-C" 'x)
(bind-key* "C-c M-D" 'x)
(bind-key* "C-c M-E" 'x)
(bind-key* "C-c M-F" 'x)
(bind-key* "C-c M-G" 'x)
(bind-key* "C-c M-H" 'x)
(bind-key* "C-c M-I" 'x)
(bind-key* "C-c M-J" 'x)
(bind-key* "C-c M-K" 'x)
(bind-key* "C-c M-L" 'x)
(bind-key* "C-c M-M" 'x)
(bind-key* "C-c M-N" 'x)
(bind-key* "C-c M-O" 'x)
(bind-key* "C-c M-P" 'x)
(bind-key* "C-c M-Q" 'x)
(bind-key* "C-c M-R" 'x)
(bind-key* "C-c M-S" 'x)
(bind-key* "C-c M-T" 'x)
(bind-key* "C-c M-U" 'x)
(bind-key* "C-c M-V" 'x)
(bind-key* "C-c M-W" 'x)
(bind-key* "C-c M-X" 'x)
(bind-key* "C-c M-Y" 'x)
(bind-key* "C-c M-Z" 'x)
(bind-key* "C-c M-{" 'x)
(bind-key* "C-c M-}" 'x)
(bind-key* "C-c M-|" 'x)
(bind-key* "C-c M-:" 'x)
(bind-key* "C-c M-\"" 'x)
(bind-key* "C-c M-<" 'x)
(bind-key* "C-c M->" 'x)
(bind-key* "C-c M-?" 'x)

(bind-key* "C-c C-M-a" 'x)
(bind-key* "C-c C-M-b" 'x)
(bind-key* "C-c C-M-c" 'x)
(bind-key* "C-c C-M-d" 'x)
(bind-key* "C-c C-M-e" 'x)
(bind-key* "C-c C-M-f" 'x)
(bind-key* "C-c C-M-g" 'x)
(bind-key* "C-c C-M-h" 'x)
(bind-key* "C-c C-M-i" 'x)
(bind-key* "C-c C-M-j" 'x)
(bind-key* "C-c C-M-k" 'x)
(bind-key* "C-c C-M-l" 'x)
(bind-key* "C-c C-M-m" 'x)
(bind-key* "C-c C-M-n" 'x)
(bind-key* "C-c C-M-o" 'x)
(bind-key* "C-c C-M-p" 'x)
(bind-key* "C-c C-M-q" 'x)
(bind-key* "C-c C-M-r" 'x)
(bind-key* "C-c C-M-s" 'x)
(bind-key* "C-c C-M-t" 'x)
(bind-key* "C-c C-M-u" 'x)
(bind-key* "C-c C-M-v" 'x)
(bind-key* "C-c C-M-w" 'x)
(bind-key* "C-c C-M-x" 'x)
(bind-key* "C-c C-M-y" 'x)
(bind-key* "C-c C-M-z" 'x)
(bind-key* "C-c C-M-[" 'x)
(bind-key* "C-c C-M-]" 'x)
(bind-key* "C-c C-M-\\" 'x)
(bind-key* "C-c C-M-;" 'x)
(bind-key* "C-c C-M-'" 'x)
(bind-key* "C-c C-M-," 'x)
(bind-key* "C-c C-M-." 'x)
(bind-key* "C-c C-M-/" 'x)

(bind-key* "C-c C-M-A" 'x)
(bind-key* "C-c C-M-B" 'x)
(bind-key* "C-c C-M-C" 'x)
(bind-key* "C-c C-M-D" 'x)
(bind-key* "C-c C-M-E" 'x)
(bind-key* "C-c C-M-F" 'x)
(bind-key* "C-c C-M-G" 'x)
(bind-key* "C-c C-M-H" 'x)
(bind-key* "C-c C-M-I" 'x)
(bind-key* "C-c C-M-J" 'x)
(bind-key* "C-c C-M-K" 'x)
(bind-key* "C-c C-M-L" 'x)
(bind-key* "C-c C-M-M" 'x)
(bind-key* "C-c C-M-N" 'x)
(bind-key* "C-c C-M-O" 'x)
(bind-key* "C-c C-M-P" 'x)
(bind-key* "C-c C-M-Q" 'x)
(bind-key* "C-c C-M-R" 'x)
(bind-key* "C-c C-M-S" 'x)
(bind-key* "C-c C-M-T" 'x)
(bind-key* "C-c C-M-U" 'x)
(bind-key* "C-c C-M-V" 'x)
(bind-key* "C-c C-M-W" 'x)
(bind-key* "C-c C-M-X" 'x)
(bind-key* "C-c C-M-Y" 'x)
(bind-key* "C-c C-M-Z" 'x)
(bind-key* "C-c C-M-{" 'x)
(bind-key* "C-c C-M-}" 'x)
(bind-key* "C-c C-M-|" 'x)
(bind-key* "C-c C-M-:" 'x)
(bind-key* "C-c C-M-\"" 'x)
(bind-key* "C-c C-M-<" 'x)
(bind-key* "C-c C-M->" 'x)
(bind-key* "C-c C-M-?" 'x)
;; End Letters And Symbols With C-c Prefix

;;-----------------------------------------------------------------;;
;;-------------------------END UNBOUND KEYS------------------------;;
;;-----------------------------------------------------------------;;

;;-----------------------------------------------------------------;;
;;-------------------------BOUND KEYS------------------------------;;
;;-----------------------------------------------------------------;;

;; Turns on CUA mode.
(cua-mode t)

;; File-Handling Commands.
(bind-key* "C-e" 'find-file)
(bind-key* "C-s" 'save-buffer)
(bind-key* "M-s" 'write-file)
(bind-key* "C-x C-c" 'save-buffers-kill-emacs)
(bind-key* "C-x C-s" 'save-some-buffers)

;; Cursor Movement Commands.
(bind-key* "M-l" 'forward-char)
(bind-key* "M-j" 'backward-char)
(bind-key* "M-i" 'previous-line)
(bind-key* "M-k" 'next-line)
(bind-key* "M-u" 'beginning-of-line)
(bind-key* "M-o" 'end-of-line)
(bind-key* (kbd "<C-i>") 'scroll-down)
(bind-key* (kbd "<C-I>") 'scroll-down)
(bind-key* "C-k" 'scroll-up)
(bind-key* "C-u" 'beginning-of-buffer)
(bind-key* "C-o" 'end-of-buffer)
(bind-key* "M-;" 'recenter)
(bind-key* "C-t" 'universal-argument)

;; Deleting, Yanking, Region, and Clipboard Commands.
(bind-key* "C-x C-x" 'select-current-line) ;; TODO LATER: Macro to unhighlight line if I move cursor.
(bind-key* "C-a" 'mark-whole-buffer)
(bind-key* "M-SPC" 'cua-exchange-point-and-mark) ;; TODO LATER: Possibly macro to move mark to end-of-line after copy.

;; Stopping and Undoing Commands.
(bind-key* "C-g" 'keyboard-escape-quit) ;; TODO LATER: Possibly imoprove functionality to work in mini-buffer.

;; Search And Replace Commands.
(bind-key* "C-f" 'isearch-forward)
(bind-key "C-l" 'isearch-repeat-forward isearch-mode-map)
(bind-key "C-j" 'isearch-repeat-backward isearch-mode-map)
(bind-key* "M-f" 'query-replace)

;; TODO LATER: Macro to switch/swap/open up and format certain amount of buffers for coding.
;; Buffer Commands.
(bind-key* (kbd "<C-tab>") 'buffer-menu)

;; Windows And Frames.
(bind-key* "C-n" 'split-window-horizontally)
(bind-key* (kbd "<C-m>") 'split-window-vertically)
(bind-key* (kbd "<C-M>") 'split-window-vertically)
(bind-key* "C-x j" 'delete-window)
(bind-key* "C-x l" 'delete-other-windows)
(bind-key* "C-+" 'enlarge-window)
(bind-key* "C-_" 'shrink-window)
(bind-key* "C-=" 'enlarge-window-horizontally)
(bind-key* "C--" 'shrink-window-horizontally)
(bind-key* "C-M-j" 'windmove-left)
(bind-key* "C-M-l" 'windmove-right)
(bind-key* "C-M-i" 'windmove-up)
(bind-key* "C-M-k" 'windmove-down)

;; TODO LATER: Finish these binds, once I start getting the hang of it.
;; Shell Mode Commands.
(bind-key* "<f1>" 'shell)
;;(bind-key "C-l" 'shell-foward-command)
;;(bind-key "C-j" 'shell-backward-command)
;;(bind-key* "M-c" 'comint-interrupt-subjob)
;;(bind-key* "M-z" 'comint-stop-subjob)

;; Compilation Mode Commands.
;;(bind-key* "M-i" 'compilation-previous-error)
;;(bind-key* "M-k" 'compilation-next-error)
;;(bind-key* "M-n" 'compilation-goto-error)

;; Company Commands.
(bind-key "C-l" 'company-select-next)
(bind-key "C-j" 'company-select-previous)
(with-eval-after-load 'company
  (bind-key "<tab>" 'company-complete-selection company-active-map))

;;-----------------------------------------------------------------;;
;;-------------------------END BOUND KEYS--------------------------;;
;;-----------------------------------------------------------------;;

;;-----------------------------------------------------------------;;
;;-----------------------------------------------------------------;;
;;-----------------------------------------------------------------;;
;;-------------------------END KEYBINDINGS-------------------------;;
;;-----------------------------------------------------------------;;
;;-----------------------------------------------------------------;;
;;-----------------------------------------------------------------;;
  • 2
    Can you elaborate on what sort of approach you're hoping for? If you don't actually want to "wipe every global keybind" (a.k.a. "totally obliterate the global keymap" -- which you have a simple solution for already), then I'm unsure what you're asking. – phils Jan 21 '18 at 3:10
  • 1
    @Drew Maybe I'm not understanding what a keymap is fully? I'll try to clarify what I'm trying to say (I also added what's in my .emacs file): 1) I can't stand the default global keybinds. 2) I want to obliterate the global keymap. 3) After which I want to make a new keymap. 4) In this new keymap I want to fully customize the binds to my liking. 5) I want to then use said keymap for my global keymap. – John Jan 21 '18 at 5:33
  • 2
    @John, perhaps what you're missing is that with (use-global-map (make-sparse-keymap)) you have created a new global keymap. Having done that, you can simply start defining global keys as normal. – phils Jan 21 '18 at 12:24
  • 2
    As side notes: (1) Binding a key to the command nil is how you unbind a key from a keymap. (2) A command named ignore exists, and you might prefer that to the likes of your x defun (notwithstanding your call to message). – phils Jan 21 '18 at 12:32
  • 3
    This really smacks of being an XY question. As you can see from comments and an answer, no one can imagine wanting, let alone needing to do this. That doesn't imply it cannot be useful, but since you give no motivation for doing it, it does suggest that you are heading in a mistaken direction. Try specifying what it is that you are really trying to do (think why). – Drew Jan 21 '18 at 15:35
2

You've already got the answer: delete the existing keymap, create a new one, then define key bindings in it.

(use-global-map nil) will delete the global keymap, which nukes everything. (make-sparse-keymap) creates a brand new keymap with no keys defined in it. (use-global-map (make-sparse-keymap)) saves you a step by doing both in one go.

Now all you have to do is start defining keys just like you're already doing.

Of course, I can't really recommend doing this. All of the buffers I have open at the moment have between 1000 and 2000 keybindings. (You can use C-h b to show all available keybindings in the keymap used by the current buffer) While I don't know every single one of those by heart, it would take a long time to come up with a keybinding scheme of my own which covers the ones I do know.

Edit:

You asked about the ordinary self-inserting keys in the comments, so here's what they look like in the output of C-x b (slightly edited for clarity):

Global Bindings:
key               binding
---               -------

SPC .. ~          self-insert-command
\200 .. \17777577 self-insert-command
\200 .. \377      self-insert-command

You'll want to recreate these bindings in your new keymap by looping through all of these characters and binding them to the self-insert-command function.

  • Great answer. Thanks you. But if I might add: when using C-h b doesn't show me the the binds for inserting the individual characters: "a", "b", "c", "d", etc. Where can I find those bindings? – John Jan 21 '18 at 22:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.