view .elisp/settings/90.keybindings.el @ 175:4741c022c7ae

python-mode: apply patch from the python-mode list to fix triplequotes. This patch is originally by Andreas Roehler <andreas.roehler at online.de>. It was not applied because it works only in GNU Emacs based on list archives.
author Augie Fackler <durin42@gmail.com>
date Wed, 16 Dec 2009 22:59:38 -0600
parents efe94205bf07
children 70dcdb2acade
line wrap: on
line source

;; Key Bindings
; M-backspace kills the current buffer
(global-set-key [(meta backspace)] 'kill-this-buffer)
; Save early and often, with only one keystroke
(global-set-key [(meta s)] 'save-buffer)
; Typing tab is for lesser editors, make hitting return do that
(global-set-key "\C-m" 'indent-new-comment-line)
; M-l makes more sense to me for jumping to a line
(global-set-key "\M-l" 'goto-line)
; Sometimes C-h is what Backspace sends in a terminal, and I never use C-h
(global-set-key "\C-h" 'backward-delete-char-untabify)
; M-t is what I want for the textmate file finding
(global-set-key [(meta t)] 'textmate-goto-file)
; M-p for bouncing to the matching paren
(global-set-key [(meta p)] 'bounce-to-other-paren)
(global-set-key [(meta control f)] 'textmate-find-in-project-type)
(global-set-key [(meta shift f)] 'textmate-find-in-project)
(global-set-key [(meta m)] 'iconify-or-deiconify-frame)
(global-set-key [(control backspace)] 'kill-word)

(global-set-key [f3] 'next-error)

;; M-j for jump to function definition
(global-set-key [(meta j)] 'textmate-goto-symbol)

;; commit emacs heresy?
(global-set-key [(meta r)] 'execute-extended-command)

;; Mac-like keybindings for undo/cut/copy/paste
(global-set-key [(meta c)] 'kill-ring-save)
(global-set-key [(meta x)] 'kill-region)
(global-set-key [(meta z)] 'undo)
(global-set-key [(meta v)] 'yank)
(global-set-key [M-return] 'fullscreen)
(global-set-key [(control v)] 'yank-pop)

;; Fixup hooks for modes that like taking my keys back
(add-hook 'text-mode-hook '(lambda ()
                             (define-key text-mode-map "\M-s"
                               'save-buffer)))
(add-hook 'comint-mode-hook '(lambda ()
                               (local-set-key "\M-r"
                                              'execute-extended-command)))

(defun server-save-buffer-and-finish ()
  (interactive)
  (save-buffer) (server-edit))
(add-hook 'server-switch-hook
          '(lambda ()(local-set-key "\M-s" 'server-save-buffer-and-finish )))