2012-08-25

Favorite emacs key-bindings


(global-set-key "\M-n"  'next-buffer)
(global-set-key "\M-p"  'previous-buffer)
(global-set-key (kbd "C-c w") (quote copy-word))
(global-set-key (kbd "C-c l") (quote copy-line))
(global-set-key (kbd "C-c p") (quote copy-paragraph))
(global-set-key (kbd "C-c s") (quote thing-copy-string-to-mark))
(global-set-key (kbd "C-c a") (quote thing-copy-parenthesis-to-mark))

(global-set-key "\C-o"  'other-window)
(global-set-key "\M-o"  'other-window)

(defvar my-keys-minor-mode-map (make-keymap) "my-keys-minor-mode keymap.")
(define-key my-keys-minor-mode-map (kbd "C-,") 'beginning-of-buffer)
(define-key my-keys-minor-mode-map (kbd "C-.") 'end-of-buffer)
(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)
(global-set-key (kbd "C-M-'") 'er/expand-region)
(define-key global-map (kbd "C-c SPC") 'ace-jump-mode)
(define-key global-map (kbd "C-;") 'ace-jump-char-mode)
(define-key global-map (kbd "C-'") 'ace-jump-line-mode)
(require 'mark-more-like-this)
(global-set-key (kbd "C-<") 'mark-previous-like-this)
(key-chord-define-global "zz" 'mark-previous-like-this)
(global-set-key (kbd "C->") 'mark-next-like-this)
(key-chord-define-global "??" 'mark-next-like-this)
(global-set-key (kbd "C-M-m") 'mark-more-like-this) 
(global-set-key (kbd "C-*") 'mark-all-like-this)
(key-chord-define-global ",," 'mark-all-like-this)
(key-chord-define-global "zk" 'zap-to-char)
(key-chord-define-global ";w" 'kill-region)
;;accumulate-kill
(defun append-kill-line (&optional arg)
  "Append kill-line to current kill buffer, prefix arg kills from beginning of line."
  (interactive "P")
  (append-next-kill)
  (kill-line arg)
)
(define-key global-map "\C-x\C-m" 'append-kill-line)






More on github.

2 comments:

  1. Duplicate current line or region in Emacs

    http://tuxicity.se/emacs/elisp/2010/03/11/duplicate-current-line-or-region-in-emacs.html

    ReplyDelete
  2. Smooth scrolling
    http://emacs.wordpress.com/2007/09/10/smooth-scrolling/

    ReplyDelete