find-file: Backspace acting differently on ssh and local

34 views
Skip to first unread message

Florian Lindner

unread,
Apr 2, 2015, 4:46:10 AM4/2/15
to emacs...@googlegroups.com
Hello,

I have some advices for helm-ff to create an ido like behavior when using
backspace (going up one directory level) and enter.

- I'm in a local buffer, use helm-find-files, pressing backspace deletes an
entire directory level.

- I'm in a tramp ssh remote buffer, backspace in helm-ff just deletes a
single character.

How can I get the local behavior for remote too? Why is it different?

My config looks like that:

(use-package helm
:ensure t
:init (progn
(defun flo/helm-find-files-navigate-forward (orig-fun &rest args)
(if (file-directory-p (helm-get-selection))
(apply orig-fun args)
(helm-maybe-exit-minibuffer)))

(defun flo/helm-find-files-navigate-back (orig-fun &rest args)
(if (= (length helm-pattern) (length (helm-find-files-initial-
input)))
(helm-find-files-up-one-level 1)
(apply orig-fun args)))
)
:config (progn
(helm-mode t)
;; (add-to-list 'helm-completing-read-handlers-alist '(find-
file . ido))
(setq helm-M-x-fuzzy-match t
helm-buffers-fuzzy-matching t
helm-buffer-max-length 30
helm-recentf-fuzzy-match t
helm-ff-skip-boring-files)

(advice-add 'helm-execute-persistent-action :around #'flo/helm-
find-files-navigate-forward)
(define-key helm-find-files-map (kbd "<return>") 'helm-execute-
persistent-action)

(advice-add 'helm-ff-delete-char-backward :around #'flo/helm-
find-files-navigate-back)
)
:bind (
("M-x" . helm-M-x)
("M-y" . helm-show-kill-ring)
("C-x b" . helm-mini)
("C-x C-f" . helm-find-files)
("C-h a" . helm-apropos) )
)


Or is there an helm option to achieve that behavior? Compared to ido when
opening files I'm still much slower with helm, this tries to fix some of the
obstacles.

Thanks,
Florian

Thierry Volpiatto

unread,
Apr 2, 2015, 5:21:57 AM4/2/15
to emacs...@googlegroups.com

Florian Lindner <mailin...@xgm.de> writes:

> Hello,
>
> I have some advices for helm-ff to create an ido like behavior when using
> backspace (going up one directory level) and enter.

Please try to get used of helm default commands, they do the right
thing, <backspace> is implemented specially in helm (handle auto update)
and can't be modified like this.

> Or is there an helm option to achieve that behavior? Compared to ido when
> opening files I'm still much slower with helm,

It is not if you use C-l/C-j (or left and right).


--
Thierry
Get my Gnupg key:
gpg --keyserver pgp.mit.edu --recv-keys 59F29997

Florian Lindner

unread,
Apr 2, 2015, 7:22:27 AM4/2/15
to emacs...@googlegroups.com
Thierry Volpiatto wrote:

>
> Florian Lindner <mailin...@xgm.de> writes:
>
>> Hello,
>>
>> I have some advices for helm-ff to create an ido like behavior when using
>> backspace (going up one directory level) and enter.
>
> Please try to get used of helm default commands, they do the right
> thing, <backspace> is implemented specially in helm (handle auto update)
> and can't be modified like this.

One reason of using emacs that I can customize it in a way I see it fit.
This is not necessarily the way the package author sees it.

I tried to get used to helm's defaults for several week when I started using
it, but imho some defaults are not optimal. One of things that bugs me most
is the behavior of Return and Backspace in helm-find-files. I still try to
to configure helm the way I want to use it. You're seemingly telling me to
ditch helm in favor of ido if I don't like the defaults?

Obviously for me "the right thing" (TM) is something else then for you.

>> Or is there an helm option to achieve that behavior? Compared to ido when
>> opening files I'm still much slower with helm,
>
> It is not if you use C-l/C-j (or left and right).

For me it is definately slower. It's a pity you fail to see how your way is
not the right one for everyone.

Best Regards,
Florian

Reply all
Reply to author
Forward
0 new messages