Previously when using counsel-find-file, to find a file relative to
If you had typed
With this change it doesn't trigger the jump to home just on typing
Previously when using counsel-find-file, to find a file relative to the home directory one needed to type `~$FILENAME`. This is counter to lots of training/convention in using shells. If you had typed `~/$FILENAME` it would be relative the root as `~` would jump to home and then `/` would jump to root. With this change it doesn't trigger the jump to home just on typing the tilde, it waits for tilde-slash.
I don't agree with this implementation. You're preventing the users that have no preference for
I would prefer the following solution:
A simpler solution that's even more preferable is you putting this in your personal config:
(define-key ivy-mode-map (kbd "~/") (lambda () (interactive) (ivy--cd "~/")))
I tried to tell myself that
I don't think that one character efficiency is worth being different than every other system. I get that I'm proposing a change to existing behavior though... If that change is unacceptable (even to bring it semantically inline with other systems) then I suspect there is no good solution here that doesn't involve keeping a lot of back history and making the code much more complex.
I tried the define-key solution; I think it works much less well. With that key chord in place tilde becomes a prefix and nothing at all happens when you type
In the above desired behavior I would say that point two is incorrect. E.g. the input
Point 1 is suboptimal for completing
(if (string-match "\\`~\\(.*\\)/\\'" ivy-text) (ivy--cd (expand-file-name ivy-text)) (if (string-match "/\\'" ivy-text) (ivy--magic-file-slash)))
Running the patch for a couple days now on my machine hasn't cause problems with tramp paths.