Ok. After trying to formulate this question a couple of times, it turns out that this will be a long one. Anywho:
Consider this file structure:
photos/ ants/ pic1.jpg animals/ dog.png profile_pic.jpg
if you do
cd photos ls
ants/ animals/ profile_pic.jpg
However since the directories vacation and animals only contain one file each, it could arguably be more useful to get
ants/pic1.jpg ani../dog.png profile_pic.jpg
directly, as opposed to having to visit each of animals and vacation. On tab completion however, as in cd a you would want suggestions of the directories instead.
So I know bash completion is handled by the /etc/bash_completion script (I don't wanna go there) and the readline library, but this doesn't really affect ls and certainly doesn't help if you want to extend functionality to file managers such a nautilus. Therefore I was hoping some of this could be tackled using a custom filesystem over fuse. A initial investigation based on this tutorial was somewhat depressing though, as the fuse file system seems to in no way differentiate between my different use cases (readdir, opendir, releasedir every time).
To formulate a question: In what way could a similar functionality be approached, if it's even possible without major revision in the kernel? Where should I look for more information?
Thanks for you time!
EDIT: To clarify, bash is a useful example, but in the end I want this to be the same through nautilus and every other program accessing the files, and I'm gonna write a file system anyway for other issues.