|
|
Nicolas Alvarez <nic### [at] gmailcom> wrote:
> Recent versions of bash come preconfigured for smart autocomplete. Random
> example:
> apt-get remove <tab> completes package names you already have installed.
I like the smart autocomplete in zsh. For example, if I write this in zsh:
mplayer -su<tab>
it will autocomplete it to "mplayer -sub", but since that's not the only
possible valid completion, if I press tab again, it will list all the
possibities:
mplayer -sub<tab>
-sub -- use specified subtitle file
-sub-bg-alpha -subcp -subfont-osd-scale
-sub-bg-color -subdelay -subfont-outline
-sub-no-text-pp -subfont-autoscale -subfont-text-scale
-subalign -subfont-blur -subfps
-subcc -subfont-encoding -subpos
The autocompletion of file names is also application-dependent. For
example, if I have three files in the current directory, let's say
test.txt, test.cc and test.pdf, if I write this:
acroread t<tab>
it will directly autocomplate to "test.pdf" because that's the only one
of those files which is valid for acroread.
Also if I have a bunch of files whose names start with a 't', and all
of them have the access rights "-rw-r--r--" except one, which has the
rights "-rw-------", and then I write this:
chmod og+r t<tab>
it will directly autocomplete to the only file for which that command
makes sense (ie. the file which didn't have the +r rights already).
--
- Warp
Post a reply to this message
|
|