TurboCd prepends '/' to the path
hasufell opened this issue · comments
When I type /
to switch to TurboCd, then start typing and then cycle through the options in the current dir, it prepends /
to those directories. When I want to switch, it does nothing, because they don't exist top-level.
Ooops! Will fix that right now.
853cf53 fix prepended "/" when completing directory
d18836d fix garbage completion with partial directory name and trailing /
Still a bit underwhelming, since it doesn't actually switch to the directory on a unique match (and no further completions without at least one letter). I guess it would be nice if it also filtered everything in the current directory that doesn't match the input.
In a branch I have an overhauled minibuffer with shell syntax highlighting, red/green highlighting for wrong/right filenames, filtered previews for all the executables in $PATH when entering a command and much better navigation (with filtering and automatic dir change)...
I should finish that up, but in the meantime I'll probably add the filter/dir change to it as it is, since that's really nice to have.
I guess it would be nice if it also filtered everything in the current directory that doesn't match the input.
Exactly! This is a must-have feature imo for fast navigation. Pretty similar to auto-complete in shells. I would go so far to say there should be a mode where all ascii-keystrokes are just filter keystrokes, unless you hit a modifier.
Done! While in this mode you can move the selection up/down with history up/down (C/M-p/n by default). Cancelling with C-c resets the directory and the previous selection. "../" does what you would expect.
Open questions:
- This interacts with the regular filter feature. Currently it saves and restores the current filter of each directory when entering/leaving a dir. Not sure if regular filters should be disabled completely in this mode since it could be confusing otherwise (or if it should work on top of them instead of replacing/restoring them).
- It works for directories, as well as files. Not yet sure if this is a pro or a con.
- Actually entering a directory requires pressing "/" once. I had it enter a directory as soon as there is only one candidate at first but it felt a bit erratic since it's not always easy to predict when adding another letter makes all the other directories go away. Make this an option?
- It's currently "fuzzy" in that it looks for matches anywhere in the file name. I think this is usually better, but not always. Which leads to....
Nice to have:
- Highlighting the matched substring within the file name for easier parsing
- Support for regex, or at least shell style globbing. There's conditional globbing in that other branch for inputs with glob characters....
Hmm, it's better, but I was ultimately envisioning something a little more radical.
See, 80% of the time, when using a filemanager, I navigate. The other 20% of the time I interact with files (and want to do operations the filemanager doesn't support, like diffing, taring, ...).
So, IMO, the default mode of a filemanager should always be view only and keypresses should be by default filtering. This is actually the case for e.g. SpaceFM (gtk+). Normal keypresses start a search box and move the selector to the next best match.