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:
parent
61c97b7dda
commit
b256475325
|
@ -99,6 +99,7 @@
|
||||||
- [[#special-buffers][Special Buffers]]
|
- [[#special-buffers][Special Buffers]]
|
||||||
- [[#files-manipulations-key-bindings][Files manipulations key bindings]]
|
- [[#files-manipulations-key-bindings][Files manipulations key bindings]]
|
||||||
- [[#emacs-and-spacemacs-files][Emacs and Spacemacs files]]
|
- [[#emacs-and-spacemacs-files][Emacs and Spacemacs files]]
|
||||||
|
- [[#browsing-files-with-helm][Browsing files with Helm]]
|
||||||
- [[#ido][Ido]]
|
- [[#ido][Ido]]
|
||||||
- [[#ido-micro-state][Ido micro-state]]
|
- [[#ido-micro-state][Ido micro-state]]
|
||||||
- [[#neotree-file-tree][NeoTree file tree]]
|
- [[#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 R~ | resync the dotfile with spacemacs |
|
||||||
| ~SPC f e v~ | display and copy the spacemacs version |
|
| ~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
|
*** Ido
|
||||||
=Spacemacs= displays the =ido= minibuffer vertically thanks to the
|
=Spacemacs= displays the =ido= minibuffer vertically thanks to the
|
||||||
[[https://github.com/gempesaw/ido-vertical-mode.el][ido-vertical-mode]].
|
[[https://github.com/gempesaw/ido-vertical-mode.el][ido-vertical-mode]].
|
||||||
|
@ -2502,11 +2516,12 @@ setup the key on tabulation:
|
||||||
=Spacemacs= add =hjkl= navigation to =helm= buffers:
|
=Spacemacs= add =hjkl= navigation to =helm= buffers:
|
||||||
|
|
||||||
| Key Binding | Description |
|
| Key Binding | Description |
|
||||||
|-------------+---------------------|
|
|-------------+------------------------------|
|
||||||
| ~C-h~ | go to previous page |
|
| ~C-h~ | go to next source |
|
||||||
| ~C-j~ | go to previous item |
|
| ~C-H~ | describe key (replace ~C-h~) |
|
||||||
| ~C-k~ | go to next item |
|
| ~C-j~ | go to previous candidate |
|
||||||
| ~C-l~ | go to next page |
|
| ~C-k~ | go to next candidate |
|
||||||
|
| ~C-l~ | same as ~return~ |
|
||||||
|
|
||||||
** Emacs Server
|
** Emacs Server
|
||||||
=Spacemacs= starts a server at launch. This server is killed whenever you close
|
=Spacemacs= starts a server at launch. This server is killed whenever you close
|
||||||
|
|
|
@ -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)
|
;; helm-locate uses es (from everything on windows, which doesnt like fuzzy)
|
||||||
(setq helm-locate-fuzzy-match (executable-find "locate"))
|
(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)
|
(defun spacemacs//helm-do-grep-region-or-symbol (&optional targs use-region-or-symbol-p)
|
||||||
"Version of `helm-do-grep' with a default input."
|
"Version of `helm-do-grep' with a default input."
|
||||||
(interactive)
|
(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'."
|
ARG non nil means that the editing style is `vim'."
|
||||||
(cond
|
(cond
|
||||||
(arg
|
(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-j") 'helm-next-line)
|
||||||
(define-key helm-map (kbd "C-k") 'helm-previous-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-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
|
(t
|
||||||
(define-key helm-map (kbd "C-j") 'helm-execute-persistent-action)
|
(define-key helm-map (kbd "C-j") 'helm-execute-persistent-action)
|
||||||
(define-key helm-map (kbd "C-k") 'helm-delete-minibuffer-contents)
|
(define-key helm-map (kbd "C-k") 'helm-delete-minibuffer-contents)
|
||||||
|
|
Loading…
Reference in a new issue