emacs - How to restore anything-like behavior for TAB autocomplete in helm? -
a related question asked here. answer used new way autocomplete works in helm. cannot used it, here's why.
say, want open file /home/user/work/f.txt
. c-x c-f, takes me current dir, /current/dir/
. hit backspace , notice autocomplete won't let me delete /
. ok, turn off autocomplete c-backspace. kill line c-a c-k , start typing. notice autocomplete doesn't work, turn on c-backspace. type part know unique, e.g. /hom
, hit tab.
not here. type /ho
, autocomplete resolves /home/
, since type fast, end /home/m
, , continue typing meaningless characters until notice it. chances are, time got autocompleted directories had no intent of going.
so have watch autocomplete doing, rather rely on type , checking suggested completions when hit tab.
i find myself descending wrong directories due occasional typo, , having difficulty going level -- evil autocomplete won't let fix situation couple of backspaces.
this interaction of autocomplete behavior , removal of tab functionality upsets work, decided ask question. looking either:
- restore old functionality
- learn how use autocomplete in meaningful way, or
- configure helm's c-x c-f behave more linux command line
please help.
here ido
tricks if want start using it. let me know if helm
better, perhaps i'll switch over. tried once shortly, didn't it.
basic setup:
this give `ido-find-file on c-x c-f.
(ido-mode) (setq ido-enable-flex-matching t)
smex setup:
install https://github.com/nonsequitur/smex.
(require 'smex) (global-set-key "\c-t" 'smex)
switch buffers ido:
(global-set-key "η" (lambda()(interactive) (when (buffer-file-name) (save-buffer)) (ido-switch-buffer))) (global-set-key (kbd "c-η") (lambda()(interactive) (let ((ido-default-buffer-method 'other-window)) (ido-switch-buffer))))
tricks:
;; 1 (add-hook 'dired-mode-hook (lambda() (define-key dired-mode-map "j" 'ido-find-file))) (add-hook 'ido-setup-hook (lambda() ;; 2 (define-key ido-file-dir-completion-map "~" (lambda ()(interactive) (ido-set-current-directory "~/") (setq ido-exit 'refresh) (exit-minibuffer))) ;; 3 (define-key ido-buffer-completion-map "η" 'ido-next-match) ;; 4 (define-key ido-buffer-completion-map (kbd "c-p") 'ido-fallback-command) ;; 5 (define-key ido-completion-map (kbd "c-.") 'smex-find-function) (define-key ido-completion-map (kbd "c-,") 'smex-describe-function)))
- quick open file dired.
- move home directory 1 key faster (i.e.
~
instead of~/
). - cycle buffer candidates same key shows candidates (a la
c-tab
in firefox). - useful have fall when want create file-less buffer (ido try select existing buffer unless fall back).
- useful jump function definition/documentation.
Comments
Post a Comment