diff --git a/doc/DOCUMENTATION.org b/doc/DOCUMENTATION.org index e56f12da9..bed9755c6 100644 --- a/doc/DOCUMENTATION.org +++ b/doc/DOCUMENTATION.org @@ -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 diff --git a/layers/+distribution/spacemacs-base/packages.el b/layers/+distribution/spacemacs-base/packages.el index 28d839bb3..d33be7ee2 100644 --- a/layers/+distribution/spacemacs-base/packages.el +++ b/layers/+distribution/spacemacs-base/packages.el @@ -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)