multiple-cursors.el 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. (add-to-list 'load-path "~/.emacs.d/modes/multiple-cursors")
  2. (require 'multiple-cursors)
  3. ;; Expand region (increases selected region by semantic units)
  4. (require 'expand-region)
  5. (global-set-key (kbd "C-'") 'er/expand-region)
  6. ;; Experimental multiple-cursors
  7. (global-set-key (kbd "C-c Q") 'mc/edit-lines)
  8. (global-set-key (kbd "C-c A") 'mc/edit-ends-of-lines)
  9. (global-set-key (kbd "C-c Z") 'mc/edit-beginnings-of-lines)
  10. ;; Mark additional regions matching current region
  11. (global-set-key (kbd "s-b") 'mc/mark-all-dwim)
  12. (global-set-key (kbd "s-<") 'mc/mark-previous-like-this)
  13. (global-set-key (kbd "s->") 'mc/mark-next-like-this)
  14. (global-set-key (kbd "s-z") 'mc/mark-all-like-this)
  15. (global-set-key (kbd "s-c") 'mc/mark-more-like-this-extended)
  16. (global-set-key (kbd "s-v") 'mc/mark-all-in-region)
  17. ;; Symbol and word specific mark-more
  18. (global-set-key (kbd "s-g") 'mc/mark-next-word-like-this)
  19. (global-set-key (kbd "s-f") 'mc/mark-previous-word-like-this)
  20. (global-set-key (kbd "s-t") 'mc/mark-all-words-like-this)
  21. (global-set-key (kbd "s-e") 'mc/mark-next-symbol-like-this)
  22. (global-set-key (kbd "s-d") 'mc/mark-previous-symbol-like-this)
  23. (global-set-key (kbd "s-r") 'mc/mark-all-symbols-like-this)
  24. ;; Extra multiple cursors stuff
  25. (global-set-key (kbd "C-¿") 'mc/reverse-regions)
  26. (global-set-key (kbd "M-¿") 'mc/sort-regions)
  27. (global-set-key (kbd "s-¿") 'mc/insert-numbers)
  28. (global-set-key (kbd "C-s-<mouse-1>") 'mc/add-cursor-on-click)
  29. ;; Set anchor to start rectangular-region-mode
  30. (global-set-key (kbd "S-SPC") 'set-rectangular-region-anchor)
  31. ;; Replace rectangle-text with inline-string-rectangle
  32. (global-set-key (kbd "C-x r t") 'inline-string-rectangle)
  33. ;; Quickly jump in document with ace-jump-mode
  34. (define-key global-map (kbd "C-ø") 'ace-jump-mode)
  35. ;; Perform general cleanup.
  36. (global-set-key (kbd "C-c n") 'cleanup-buffer)
  37. (global-set-key (kbd "C-c C-n") 'cleanup-buffer)
  38. (global-set-key (kbd "C-c C-<return>") 'delete-blank-lines)
  39. ;; M-i for back-to-indentation
  40. (global-set-key (kbd "M-i") 'back-to-indentation)