Skip to content

Instantly share code, notes, and snippets.

@dbushenko
Created July 1, 2011 18:25
Show Gist options
  • Save dbushenko/1059125 to your computer and use it in GitHub Desktop.
Save dbushenko/1059125 to your computer and use it in GitHub Desktop.
my minor mode
(global-unset-key (kbd "C-c l"))
(global-set-key (kbd "C-c l") 'toggle-truncate-lines)
(set-face-attribute
'default (selected-frame) :font
"Consolas 12")
(require 'ido)
(ido-mode t)
(setq ido-enable-flex-matching t)
(setq show-paren-style 'expression)
(require 'linum+)
(setq linum-format "%d ")
(global-linum-mode 1)
(require 'yasnippet) ;; not yasnippet-bundle
(yas/initialize)
(yas/load-directory "~/.emacs.d/snippets")
(setq make-backup-files nil) ; Don't want any backup files
(setq auto-save-list-file-name nil) ; Don't want any .saves files
(setq auto-save-default nil) ; Don't want any auto saving
(setq search-highlight t) ; Highlight search object
(setq query-replace-highlight t) ; Highlight query object
(setq mouse-sel-retain-highlight t) ; Keep mouse high-lightening
(defvar ergoemacs-keymap (make-sparse-keymap)
"ErgoEmacs minor mode keymap.")
(define-key (current-global-map) [(f1)] nil)
(define-key (current-global-map) [(f1)] 'my-keys)
(define-key (current-global-map) (kbd "C-j") nil)
(define-key (current-global-map) (kbd "C-k") nil)
(define-key (current-global-map) (kbd "C-l") nil)
(define-key (current-global-map) (kbd "C-i") nil)
(define-key (current-global-map) (kbd "C-S-i") nil)
(define-key (current-global-map) (kbd "C-S-k") nil)
(define-key (current-global-map) (kbd "C-S-l") nil)
(define-key (current-global-map) (kbd "C-S-j") nil)
(define-key (current-global-map) (kbd "C-z") nil)
(define-key (current-global-map) (kbd "C-n") nil)
(define-key (current-global-map) (kbd "C-S-n") nil)
(define-key (current-global-map) (kbd "C-m") nil)
(define-key (current-global-map) (kbd "M-i") nil)
(define-key (current-global-map) (kbd "M-k") nil)
(define-key (current-global-map) (kbd "M-l") nil)
(define-key (current-global-map) (kbd "M-i") nil)
(define-key (current-global-map) (kbd "C-b") nil)
(define-key (current-global-map) (kbd "M-b") nil)
(define-key (current-global-map) (kbd "C-S-u") nil)
(define-key (current-global-map) (kbd "C-S-o") nil)
(define-key (current-global-map) (kbd "C-j") 'backward-char)
(define-key (current-global-map) (kbd "C-k") 'next-line)
(define-key (current-global-map) (kbd "C-l") 'forward-char)
(define-key (current-global-map) (kbd "C-i") 'previous-line)
(define-key (current-global-map) (kbd "C-u") 'move-beginning-of-line)
(define-key (current-global-map) (kbd "C-o") 'move-end-of-line)
(define-key (current-global-map) (kbd "C-z") 'undo)
(define-key (current-global-map) (kbd "C-S-j") 'backward-word)
(define-key (current-global-map) (kbd "C-S-l") 'forward-word)
(define-key (current-global-map) (kbd "C-S-i") 'scroll-down)
(define-key (current-global-map) (kbd "C-S-k") 'scroll-up)
(define-key (current-global-map) (kbd "C-n") 'backward-delete-char-untabify)
(define-key (current-global-map) (kbd "C-S-n") 'delete-char)
(define-key (current-global-map) (kbd "C-m") 'reindent-then-newline-and-indent)
(define-key (current-global-map) (kbd "M-j") 'windmove-left)
(define-key (current-global-map) (kbd "M-k") 'windmove-down)
(define-key (current-global-map) (kbd "M-l") 'windmove-right)
(define-key (current-global-map) (kbd "M-i") 'windmove-up)
(define-key (current-global-map) (kbd "C-b") 'bookmark-set)
(define-key (current-global-map) (kbd "M-b") 'bookmark-jump)
(define-key (current-global-map) (kbd "C-S-u") 'beginning-of-buffer)
(define-key (current-global-map) (kbd "C-S-o") 'end-of-buffer)
(defvar my-keys-map
(let ((m (make-sparse-keymap)))
(define-key m (kbd "C-j") nil)
(define-key m (kbd "C-k") nil)
(define-key m (kbd "C-l") nil)
(define-key m (kbd "C-i") nil)
(define-key m (kbd "C-S-i") nil)
(define-key m (kbd "C-S-k") nil)
(define-key m (kbd "C-S-l") nil)
(define-key m (kbd "C-S-j") nil)
(define-key m (kbd "C-z") nil)
(define-key m (kbd "C-n") nil)
(define-key m (kbd "C-S-n") nil)
(define-key m (kbd "C-m") nil)
(define-key m (kbd "M-i") nil)
(define-key m (kbd "M-k") nil)
(define-key m (kbd "M-l") nil)
(define-key m (kbd "M-i") nil)
(define-key m (kbd "C-b") nil)
(define-key m (kbd "M-b") nil)
(define-key m (kbd "C-S-u") nil)
(define-key m (kbd "C-S-o") nil)
(define-key m (kbd "C-j") 'backward-char)
(define-key m (kbd "C-k") 'next-line)
(define-key m (kbd "C-l") 'forward-char)
(define-key m (kbd "C-i") 'previous-line)
(define-key m (kbd "C-u") 'move-beginning-of-line)
(define-key m (kbd "C-o") 'move-end-of-line)
(define-key m (kbd "C-z") 'undo)
(define-key m (kbd "C-S-j") 'backward-word)
(define-key m (kbd "C-S-l") 'forward-word)
(define-key m (kbd "C-S-i") 'scroll-down)
(define-key m (kbd "C-S-k") 'scroll-up)
(define-key m (kbd "C-n") 'backward-delete-char-untabify)
(define-key m (kbd "C-S-n") 'delete-char)
(define-key m (kbd "C-m") 'reindent-then-newline-and-indent)
(define-key m (kbd "M-j") 'windmove-left)
(define-key m (kbd "M-k") 'windmove-down)
(define-key m (kbd "M-l") 'windmove-right)
(define-key m (kbd "M-i") 'windmove-up)
(define-key m (kbd "C-b") 'bookmark-set)
(define-key m (kbd "M-b") 'bookmark-jump)
(define-key m (kbd "C-S-u") 'beginning-of-buffer)
(define-key m (kbd "C-S-o") 'end-of-buffer)
(define-key m (kbd "C-c l") nil)
(define-key m (kbd "C-c l") 'toggle-truncate-lines)
m))
(define-minor-mode my-keys "My key bindings" :global t)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment