I work on projects with deep directory structures and have several copies in different top-level directories. I sometimes find myself wanting to open the corresponding file in one of the other directories.
For example, I might have ~/tree1/a/deep/directory/structure/file.txt
open and want to open ~/tree2/a/deep/directory/structure/file.txt
. When I press C-x C-f counsel-find-file
I'm unable to move my cursor back to the 1
to change it to a 2
- I need to use backspace to delete each path component which I'll need to re-enter (with completion to help me) afterwards. This is a pain for long path names.
Something I used previously (perhaps ido or helm, but I can't seem to find it now) let me press C-x C-f again whilst in the minibuffer to go back to stock find-file
, which was sufficient to solve this problem.
I've read the ivy documentation, but I've been unable to find a way to edit the start of the filename with counsel-find-file
. Is there something I've missed?
enable-recursive-minibuffers
tot
, but IIRC another C-x C-f will start afresh, without picking up the path you've already written.find-file
instead in these cases only. Unfortunately even that doesn't work - I seem to end up withcounsel-find-file
even when I explicitly typeM-x find-file
. :(C-M-y
(ivy-insert-current-full
), which yanks the current directory for editing. See(info "(ivy) File Name Completion")
.M-x find-file RET
, and it looks likecounsel-find-file
, then it's probably because you've enabledivy-mode
, which enables Ivy-style file name completion even without usingcounsel-find-file
.ivy-insert-current-full
works, even it the appearance is a bit confusing with the editable path concatenated onto the end of the original path until I hit tab to complete. Thanks!