Helm: Implement workaround for ineffective bindings

This commit is contained in:
Pierre Neidhardt 2017-11-06 22:05:48 +01:00
parent f0990bb429
commit 2c0d846d8e
1 changed files with 14 additions and 21 deletions

View File

@ -38,35 +38,28 @@
;; down the file system hierarchy since we need them to use it to edit the ;; down the file system hierarchy since we need them to use it to edit the
;; minibuffer content. ;; minibuffer content.
;; TODO: This does not seem to do anything. Calling the `evil-define-key's manually works though.
(defun evil-helm-set-keys () (defun evil-helm-set-keys ()
;; TODO: We should not modify helm-map in Emacs state but somehow it does not
(evil-define-key '(insert normal) helm-map ;; work otherwise.
(kbd "C-f") 'helm-next-page (define-key helm-map (kbd "M-h") 'helm-next-source)
(kbd "C-b") 'helm-previous-page (define-key helm-map (kbd "M-l") 'helm-execute-persistent-action)
(kbd "M-h") 'helm-next-source (dolist (map (list helm-find-files-map helm-read-file-map))
(kbd "M-j") 'helm-next-line (define-key map (kbd "M-h") 'helm-find-files-up-one-level)
(kbd "M-k") 'helm-previous-line (define-key map (kbd "M-l") 'helm-execute-persistent-action) ; TODO: Inheritance does not seem to work for that binding.
(kbd "M-l") 'helm-execute-persistent-action) (define-key map (kbd "C-l") nil)) ; So the header displays the above binding.
;; (kbd "<escape>") 'helm-keyboard-quit)
(evil-define-key 'normal helm-map (evil-define-key 'normal helm-map
(kbd "<tab>") 'helm-select-action
"j" 'helm-next-line "j" 'helm-next-line
"k" 'helm-previous-line "k" 'helm-previous-line
"g" 'helm-beginning-of-buffer "g" 'helm-beginning-of-buffer
"G" 'helm-end-of-buffer "G" 'helm-end-of-buffer
(kbd "SPC") 'helm-toggle-visible-mark (kbd "SPC") 'helm-toggle-visible-mark)
;; (kbd "S-SPC") 'evil-helm-toggle-visible-mark-backwards ; TODO: Not needed?
(kbd "C-f") 'helm-next-page
(kbd "C-b") 'helm-previous-page)
(dolist (map (list helm-find-files-map helm-read-file-map)) (evil-define-key '(normal insert) helm-map
(evil-define-key 'insert map (kbd "M-j") 'helm-next-line
(kbd "M-h") 'helm-find-files-up-one-level (kbd "M-k") 'helm-previous-line
(kbd "M-l") 'helm-execute-persistent-action (kbd "C-f") 'helm-next-page
(kbd "C-l") nil))) ; So the header displays the new `helm-execute-persistent-action' binding. (kbd "C-b") 'helm-previous-page))
(provide 'evil-helm) (provide 'evil-helm)
;;; evil-helm.el ends here ;;; evil-helm.el ends here