Last active
December 20, 2015 02:09
-
-
Save ktym/6054527 to your computer and use it in GitHub Desktop.
Configuration for multi-line editing mode in Emacs 24.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;; library | |
(let ((default-directory "~/lib/lisp")) | |
(normal-top-level-add-subdirs-to-load-path)) | |
;; multiple-cursors | |
; % git clone https://github.com/magnars/multiple-cursors.el.git | |
; % mv multiple-cursors.el lib/lisp/multiple-cursors | |
(require 'multiple-cursors) | |
(global-set-key (kbd "C-c l") 'mc/edit-lines) | |
(global-set-key (kbd "C-c ^") 'mc/edit-beginnings-of-lines) | |
(global-set-key (kbd "C-c $") 'mc/edit-ends-of-lines) | |
(global-set-key (kbd "C-c .") 'mc/mark-all-like-this) | |
(global-set-key (kbd "C-c >") 'mc/mark-next-like-this) | |
(global-set-key (kbd "C-c <") 'mc/mark-previous-like-this) | |
(global-set-key (kbd "C-c #") 'mc/insert-numbers) | |
(global-set-key (kbd "C-c s") 'mc/sort-regions) | |
(global-set-key (kbd "C-c r") 'mc/reverse-regions) |
As the function string-prefix-p is only available for Emacs 23.3 or above, if you are still using older emacs (e.g., Emacs 23.1) you need to add the following code to your .emacs file:
(unless (fboundp 'string-prefix-p)
(defun string-prefix-p (shorter longer)
(let ((n (mismatch shorter longer))
(l (length shorter)))
(if (or (not n) (= n l)) l nil))))
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can watch a really cool movie on this at http://emacsrocks.com/e13.html and the Mac version of Emacs 24.3 can be downloaded from http://emacsformacosx.com/ then create an alias to point this emacs as
alias emacs='/Applications/Emacs.app/Contents/MacOS/Emacs'