Browse Source

fixed #89 - changed er/expand-region's default keybinding to C-c w

custom
Bozhidar Batsov 14 years ago
parent
commit
78bd021354
  1. 24
      modules/prelude-core.el
  2. 1
      modules/prelude-editor.el
  3. 2
      modules/prelude-global-keybindings.el

24
modules/prelude-core.el

@ -360,5 +360,29 @@ there's a region, all lines that region covers will be duplicated."
(global-set-key [M-left] 'left-word)
(message "Arrow keys navigation in buffers in now allowed."))
(require 'repeat)
(defun make-repeatable-command (cmd)
"Returns a new command that is a repeatable version of CMD.
The new command is named CMD-repeat. CMD should be a quoted
command.
This allows you to bind the command to a compound keystroke and
repeat it with just the final key. For example:
(global-set-key (kbd \"C-c a\") (make-repeatable-command 'foo))
will create a new command called foo-repeat. Typing C-c a will
just invoke foo. Typing C-c a a a will invoke foo three times,
and so on."
(fset (intern (concat (symbol-name cmd) "-repeat"))
`(lambda ,(help-function-arglist cmd) ;; arg list
,(format "A repeatable version of `%s'." (symbol-name cmd)) ;; doc string
,(interactive-form cmd) ;; interactive form
;; see also repeat-message-function
(setq last-repeatable-command ',cmd)
(repeat nil)))
(intern (concat (symbol-name cmd) "-repeat")))
(provide 'prelude-core)
;;; prelude-core.el ends here

1
modules/prelude-editor.el

@ -193,7 +193,6 @@
(put 'downcase-region 'disabled nil)
(require 'expand-region)
(global-set-key (kbd "C-@") 'er/expand-region)
;; bookmarks
(setq bookmark-default-file (concat user-emacs-directory "bookmarks")

2
modules/prelude-global-keybindings.el

@ -104,6 +104,8 @@
(global-set-key (kbd "C-x g") 'magit-status)
(global-set-key (kbd "C-c w") (make-repeatable-command 'er/expand-region))
(provide 'prelude-global-keybindings)
;;; prelude-global-keybindings.el ends here
Loading…
Cancel
Save