LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   is there a genearlization of <TAB> completion (https://www.linuxquestions.org/questions/linux-newbie-8/is-there-a-genearlization-of-tab-completion-708741/)

glinux 03-02-2009 10:47 PM

is there a genearlization of <TAB> completion
 
is it possible to rewrite or hook up different functionality to the default <TAB> completion that is available from the commandline?

that is, rather then entering the initial characters of a filename from the command line, i enter a substring of the filename(not necessarily anchored to the beginning) and a list of matching or optional files is displayed?

this would appear to be more useful rather then entering redundant text that fails to quickly narrow done potential matches, as often happens when restricted to typing text that is anchored to the beginning of a filename.

this is somewhat similar to incremental-i-search - functionality like this for <TAB> completion would be useful - in place of navigating history, <TAB> completion would search filename in the current directory and list any matches.

another example is, in place of the default behaviour on hitting <TAB> a list of closely matching filenames is displayed; for example on hitting <TAB> for 123, files such as 1a23 or 12b3, if they existed, would be displayed as they are similar 123 eg

$ cat 123
123standardmatch.txt
another1a23.txt
here12b3.pdf

there is a version of grep that achieves this for processing files, but is there something similar for <TAB> completion?

glinux

Galaxy_Stranger 03-03-2009 12:13 AM

asdfasf
 
Sounds messy. You'd prolly get TONS of results.

Besides, Tab is only for convenience in getting to what you already know is there. If you type in the first few characters, (case-sensitive), and then hit tab 3 times, it will list all matches for you.

You might be able to get "find" to do what you want. I haven't used it for much more than simple searches.


All times are GMT -5. The time now is 09:45 PM.