 (cua-mode t) ;; use standard copy/paste commands
 (global-unset-key (kbd "C-x C-q")) ;; unset key binding for read-only mode
 
+;; define custom key bindings map
 (defvar my-keys-minor-mode-map (make-keymap) "my-keys-minor-mode keymap.")
 
 (define-key my-keys-minor-mode-map (kbd "M-n") 'backward-char)

                                                     (interactive) (revert-buffer t t t)
                                                     (message "buffer reverted")))

(define-minor-mode my-keys-minor-mode
  "A minor mode so that my key settings override annoying major modes."
  t " my-keys" 'my-keys-minor-mode-map)

(my-keys-minor-mode 1)

(defun my-minibuffer-setup-hook ()
  (my-keys-minor-mode 0))

(add-hook 'minibuffer-setup-hook 'my-minibuffer-setup-hook)


(define-key my-keys-minor-mode-map (kbd "C-x i") 'next-buffer)
(define-key my-keys-minor-mode-map (kbd "C-x n") 'previous-buffer)

(define-key my-keys-minor-mode-map (kbd "M-r") 'comment-or-uncomment-region-or-line)

