Move multiple-cursors key bindings to a separate prefix map
It becomes a prefix map anyway, but it’s much easier to rebind later if the need arises.
This commit is contained in:
		
							
								
								
									
										24
									
								
								init.el
									
									
									
									
									
								
							
							
						
						
									
										24
									
								
								init.el
									
									
									
									
									
								
							@@ -135,6 +135,11 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
;; Multiple cursors
 | 
					;; Multiple cursors
 | 
				
			||||||
(use-package multiple-cursors
 | 
					(use-package multiple-cursors
 | 
				
			||||||
 | 
					  :init
 | 
				
			||||||
 | 
					  (defvar gpolonkai/mc-prefix-map (make-sparse-keymap)
 | 
				
			||||||
 | 
					    "Prefix keymap for multiple-cursors")
 | 
				
			||||||
 | 
					  (define-prefix-command 'gpolonkai/mc-prefix-map)
 | 
				
			||||||
 | 
					  (define-key global-map (kbd "C-c m") 'gpolonkai/mc-prefix-map)
 | 
				
			||||||
  :config
 | 
					  :config
 | 
				
			||||||
  (add-hook 'multiple-cursors-mode-enabled-hook
 | 
					  (add-hook 'multiple-cursors-mode-enabled-hook
 | 
				
			||||||
            (lambda ()
 | 
					            (lambda ()
 | 
				
			||||||
@@ -142,15 +147,16 @@
 | 
				
			|||||||
  (add-hook 'multiple-cursors-mode-disabled-hook
 | 
					  (add-hook 'multiple-cursors-mode-disabled-hook
 | 
				
			||||||
            (lambda ()
 | 
					            (lambda ()
 | 
				
			||||||
              (setq blink-matching-paren t)))
 | 
					              (setq blink-matching-paren t)))
 | 
				
			||||||
  :bind (("C-c m t" . mc/mark-all-like-this)
 | 
					  :bind (:map gpolonkai/mc-prefix-map
 | 
				
			||||||
         ("C-c m m" . mc/mark-all-like-this-dwim)
 | 
					         ("t" . mc/mark-all-like-this)
 | 
				
			||||||
         ("C-c m l" . mc/edit-lines)
 | 
					         ("m" . mc/mark-all-like-this-dwim)
 | 
				
			||||||
         ("C-c m e" . mc/edit-ends-of-lines)
 | 
					         ("l" . mc/edit-lines)
 | 
				
			||||||
         ("C-c m a" . mc/edit-beginnings-of-lines)
 | 
					         ("e" . mc/edit-ends-of-lines)
 | 
				
			||||||
         ("C-c m n" . mc/mark-next-like-this)
 | 
					         ("a" . mc/edit-beginnings-of-lines)
 | 
				
			||||||
         ("C-c m p" . mc/mark-previous-like-this)
 | 
					         ("n" . mc/mark-next-like-this)
 | 
				
			||||||
         ("C-c m s" . mc/mark-sgml-tag-pair)
 | 
					         ("p" . mc/mark-previous-like-this)
 | 
				
			||||||
         ("C-c m d" . mc/mark-all-like-this-in-defun)))
 | 
					         ("s" . mc/mark-sgml-tag-pair)
 | 
				
			||||||
 | 
					         ("d" . mc/mark-all-like-this-in-defun)))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
(use-package eshell
 | 
					(use-package eshell
 | 
				
			||||||
  :config
 | 
					  :config
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user