Skip to content

Instantly share code, notes, and snippets.

@dbushenko
Created October 4, 2016 08:47
Show Gist options
  • Save dbushenko/d1cc20c2242aba487a8715a5431b9ad8 to your computer and use it in GitHub Desktop.
Save dbushenko/d1cc20c2242aba487a8715a5431b9ad8 to your computer and use it in GitHub Desktop.
;; Поиск вперед
(global-set-key (kbd "M-;") 'isearch-forward)
;; Поиск назад
(global-set-key (kbd "M-:") 'isearch-backward)
;; В режиме поиска добавляем несколько клавиш:
;; M-; -- повторить поиск вперед
;; M-: -- повторить поиск назад
;; M-v -- вставить скопированный текст
;; M-x -- вырезать выделенный текст
(defun isearch-keybindings (my-key-map)
(define-key my-key-map (kbd "M-;") 'isearch-repeat-forward)
(define-key my-key-map (kbd "M-:") 'isearch-repeat-backward)
(define-key my-key-map (kbd "M-v") 'isearch-yank-pop)
(define-key my-key-map (kbd "M-c") 'isearch-yank-kill)
(define-key my-key-map (kbd "M-x") 'isearch-yank-kill))
;; Регистрируем в isearch-mode-map объявленные выше сочетания клавиш
(add-hook 'isearch-mode-hook (lambda () (isearch-keybindings isearch-mode-map)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment