helm-find-files: use C-h and C-l to go up down a directory

Import TheBB configuration into Spacemacs and add `C-S-h` to replace
redefined `C-h` binidng.

Also remove the go up a directory behavior on backspace, now backspace
is a regular backspace.
This commit is contained in:
syl20bnr 2015-09-27 10:17:30 -04:00
parent 61c97b7dda
commit b256475325
2 changed files with 29 additions and 15 deletions

View File

@ -99,6 +99,7 @@
- [[#special-buffers][Special Buffers]]
- [[#files-manipulations-key-bindings][Files manipulations key bindings]]
- [[#emacs-and-spacemacs-files][Emacs and Spacemacs files]]
- [[#browsing-files-with-helm][Browsing files with Helm]]
- [[#ido][Ido]]
- [[#ido-micro-state][Ido micro-state]]
- [[#neotree-file-tree][NeoTree file tree]]
@ -1582,6 +1583,19 @@ navigate between =Emacs= and =Spacemacs= specific files.
| ~SPC f e R~ | resync the dotfile with spacemacs |
| ~SPC f e v~ | display and copy the spacemacs version |
**** Browsing files with Helm
In =vim= and =hybrid= styles, Spacemacs remap the navigation in Helm find-files
to keep finger on the home row.
| Key Binding | Description |
|-------------+-----------------------------------|
| ~C-h~ | go up one level (parent directory |
| ~C-H~ | describe key (replace ~C-h~) |
| ~C-j~ | go to previous candidate |
| ~C-k~ | go to next candidate |
| ~C-l~ | enter current directory |
*** Ido
=Spacemacs= displays the =ido= minibuffer vertically thanks to the
[[https://github.com/gempesaw/ido-vertical-mode.el][ido-vertical-mode]].
@ -2501,12 +2515,13 @@ setup the key on tabulation:
*** Helm
=Spacemacs= add =hjkl= navigation to =helm= buffers:
| Key Binding | Description |
|-------------+---------------------|
| ~C-h~ | go to previous page |
| ~C-j~ | go to previous item |
| ~C-k~ | go to next item |
| ~C-l~ | go to next page |
| Key Binding | Description |
|-------------+------------------------------|
| ~C-h~ | go to next source |
| ~C-H~ | describe key (replace ~C-h~) |
| ~C-j~ | go to previous candidate |
| ~C-k~ | go to next candidate |
| ~C-l~ | same as ~return~ |
** Emacs Server
=Spacemacs= starts a server at launch. This server is killed whenever you close

View File

@ -546,14 +546,6 @@ Removes the automatic guessing of the initial value based on thing at point. "
;; helm-locate uses es (from everything on windows, which doesnt like fuzzy)
(setq helm-locate-fuzzy-match (executable-find "locate"))
(defun spacemacs/helm-find-files-navigate-back (orig-fun &rest args)
)
(defadvice helm-ff-delete-char-backward
(around spacemacs/helm-find-files-navigate-back activate)
(if (= (length helm-pattern) (length (helm-find-files-initial-input)))
(helm-find-files-up-one-level 1)
ad-do-it))
(defun spacemacs//helm-do-grep-region-or-symbol (&optional targs use-region-or-symbol-p)
"Version of `helm-do-grep' with a default input."
(interactive)
@ -754,10 +746,17 @@ Removes the automatic guessing of the initial value based on thing at point. "
ARG non nil means that the editing style is `vim'."
(cond
(arg
;; better navigation on homerow
;; rebind `describe-key' for convenience
(define-key helm-map (kbd "C-j") 'helm-next-line)
(define-key helm-map (kbd "C-k") 'helm-previous-line)
(define-key helm-map (kbd "C-h") 'helm-next-source)
(define-key helm-map (kbd "C-l") 'helm-previous-source))
(define-key helm-map (kbd "C-S-h") 'describe-key)
(define-key helm-map (kbd "C-l") (kbd "RET"))
(dolist (keymap (list helm-find-files-map helm-read-file-map))
(define-key keymap (kbd "C-l") 'helm-execute-persistent-action)
(define-key keymap (kbd "C-h") 'helm-find-files-up-one-level)
(define-key keymap (kbd "C-S-h") 'describe-key)))
(t
(define-key helm-map (kbd "C-j") 'helm-execute-persistent-action)
(define-key helm-map (kbd "C-k") 'helm-delete-minibuffer-contents)