Skip to content

Instantly share code, notes, and snippets.

@ongaeshi
Last active December 19, 2015 03:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ongaeshi/5891530 to your computer and use it in GitHub Desktop.
Save ongaeshi/5891530 to your computer and use it in GitHub Desktop.
multiple-cursors.el setting.
M-x package-install multiple-cursors
M-x package-install smartrep
M-x package-install expand-region
;;--------------------------------------------------------------------------
;; multiple-cursors
;;--------------------------------------------------------------------------
(require 'multiple-cursors)
(require 'smartrep)
(declare-function smartrep-define-key "smartrep")
(global-set-key (kbd "C-M-c") 'mc/edit-lines)
(global-set-key (kbd "C-M-r") 'mc/mark-all-in-region)
(global-unset-key "\C-t")
(smartrep-define-key global-map "C-t"
'(("C-t" . 'mc/mark-next-like-this)
("C-n" . 'mc/mark-next-like-this)
("C-p" . 'mc/mark-previous-like-this)
("C-m" . 'mc/mark-more-like-this-extended)
("C-u" . 'mc/unmark-next-like-this)
("C-U" . 'mc/unmark-previous-like-this)
("C-s" . 'mc/skip-to-next-like-this)
("C-S" . 'mc/skip-to-previous-like-this)
("C-*" . 'mc/mark-all-like-this)
("C-d" . 'mc/mark-all-like-this-dwim)
("C-i" . 'mc/insert-numbers)
("C-o" . 'mc/sort-regions)
("C-O" . 'mc/reverse-regions)))
;;--------------------------------------------------------------------------
;; expand-region
;;--------------------------------------------------------------------------
(require 'expand-region)
(global-set-key (kbd "C-@") 'er/expand-region)
(global-set-key (kbd "C-M-@") 'er/contract-region)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment